diff --git a/src/main/java/net/wurstclient/Feature.java b/src/main/java/net/wurstclient/Feature.java index a750c554..8737ae84 100644 --- a/src/main/java/net/wurstclient/Feature.java +++ b/src/main/java/net/wurstclient/Feature.java @@ -14,6 +14,7 @@ import java.util.Map; import java.util.Set; import net.minecraft.client.MinecraftClient; +import net.wurstclient.event.EventManager; import net.wurstclient.keybinds.PossibleKeybind; import net.wurstclient.mixinterface.IMinecraftClient; import net.wurstclient.settings.Setting; @@ -21,6 +22,7 @@ import net.wurstclient.settings.Setting; public abstract class Feature { protected static final WurstClient WURST = WurstClient.INSTANCE; + protected static final EventManager EVENTS = WURST.getEventManager(); protected static final MinecraftClient MC = WurstClient.MC; protected static final IMinecraftClient IMC = WurstClient.IMC; diff --git a/src/main/java/net/wurstclient/commands/AnnoyCmd.java b/src/main/java/net/wurstclient/commands/AnnoyCmd.java index 757b36a2..7946acc0 100644 --- a/src/main/java/net/wurstclient/commands/AnnoyCmd.java +++ b/src/main/java/net/wurstclient/commands/AnnoyCmd.java @@ -57,13 +57,13 @@ public final class AnnoyCmd extends Command implements ChatInputListener if(player != null && target.equals(player.getName().asString())) ChatUtils.warning("Annoying yourself is a bad idea!"); - WURST.getEventManager().add(ChatInputListener.class, this); + EVENTS.add(ChatInputListener.class, this); enabled = true; } private void disable() throws CmdException { - WURST.getEventManager().remove(ChatInputListener.class, this); + EVENTS.remove(ChatInputListener.class, this); if(target != null) { diff --git a/src/main/java/net/wurstclient/commands/DropCmd.java b/src/main/java/net/wurstclient/commands/DropCmd.java index 10f550a3..089b3a1d 100644 --- a/src/main/java/net/wurstclient/commands/DropCmd.java +++ b/src/main/java/net/wurstclient/commands/DropCmd.java @@ -42,7 +42,7 @@ public final class DropCmd extends Command implements UpdateListener slowModeTimer = 5; slowModeSlotCounter = 9; - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } private void dropAllItems() @@ -65,7 +65,7 @@ public final class DropCmd extends Command implements UpdateListener slowModeTimer = 5; if(slowModeSlotCounter >= 45) - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } private void skipEmptySlots() diff --git a/src/main/java/net/wurstclient/commands/TacoCmd.java b/src/main/java/net/wurstclient/commands/TacoCmd.java index aa513543..6905ef89 100644 --- a/src/main/java/net/wurstclient/commands/TacoCmd.java +++ b/src/main/java/net/wurstclient/commands/TacoCmd.java @@ -48,13 +48,13 @@ public final class TacoCmd extends Command if(enabled) { - WURST.getEventManager().add(GUIRenderListener.class, this); - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(GUIRenderListener.class, this); + EVENTS.add(UpdateListener.class, this); }else { - WURST.getEventManager().remove(GUIRenderListener.class, this); - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(GUIRenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); } } diff --git a/src/main/java/net/wurstclient/hacks/AntiCactusHack.java b/src/main/java/net/wurstclient/hacks/AntiCactusHack.java index 114091bf..797eae17 100644 --- a/src/main/java/net/wurstclient/hacks/AntiCactusHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiCactusHack.java @@ -26,14 +26,13 @@ public final class AntiCactusHack extends Hack @Override protected void onEnable() { - WURST.getEventManager().add(CactusCollisionShapeListener.class, this); + EVENTS.add(CactusCollisionShapeListener.class, this); } @Override protected void onDisable() { - WURST.getEventManager().remove(CactusCollisionShapeListener.class, - this); + EVENTS.remove(CactusCollisionShapeListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java index 9248536e..9eb5a929 100644 --- a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java @@ -33,13 +33,13 @@ public final class AntiSpamHack extends Hack implements ChatInputListener @Override public void onEnable() { - WURST.getEventManager().add(ChatInputListener.class, this); + EVENTS.add(ChatInputListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(ChatInputListener.class, this); + EVENTS.remove(ChatInputListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/AutoDropHack.java b/src/main/java/net/wurstclient/hacks/AutoDropHack.java index 1ec6daa2..e6fa8f63 100644 --- a/src/main/java/net/wurstclient/hacks/AutoDropHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoDropHack.java @@ -49,13 +49,13 @@ public final class AutoDropHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/AutoFarmHack.java b/src/main/java/net/wurstclient/hacks/AutoFarmHack.java index 7af5da62..97ea1e97 100644 --- a/src/main/java/net/wurstclient/hacks/AutoFarmHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoFarmHack.java @@ -77,8 +77,8 @@ public final class AutoFarmHack extends Hack { plants.clear(); - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(RenderListener.class, this); displayList = GL11.glGenLists(1); box = GL11.glGenLists(1); @@ -101,8 +101,8 @@ public final class AutoFarmHack extends Hack @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(RenderListener.class, this); if(currentBlock != null) { diff --git a/src/main/java/net/wurstclient/hacks/AutoFishHack.java b/src/main/java/net/wurstclient/hacks/AutoFishHack.java index 418021af..15242342 100644 --- a/src/main/java/net/wurstclient/hacks/AutoFishHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoFishHack.java @@ -95,17 +95,17 @@ public final class AutoFishHack extends Hack GL11.glEnd(); GL11.glEndList(); - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(PacketInputListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(PacketInputListener.class, this); + EVENTS.add(RenderListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(PacketInputListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(PacketInputListener.class, this); + EVENTS.remove(RenderListener.class, this); GL11.glDeleteLists(box, 1); GL11.glDeleteLists(cross, 1); diff --git a/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java b/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java index 20c263c5..32e616af 100644 --- a/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java @@ -24,13 +24,13 @@ public final class AutoRespawnHack extends Hack implements DeathListener @Override public void onEnable() { - WURST.getEventManager().add(DeathListener.class, this); + EVENTS.add(DeathListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(DeathListener.class, this); + EVENTS.remove(DeathListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/AutoSprintHack.java b/src/main/java/net/wurstclient/hacks/AutoSprintHack.java index d7f15974..b5e28eff 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSprintHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSprintHack.java @@ -25,13 +25,13 @@ public final class AutoSprintHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/AutoSwimHack.java b/src/main/java/net/wurstclient/hacks/AutoSwimHack.java index 4a031ea4..531f1045 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwimHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwimHack.java @@ -25,13 +25,13 @@ public final class AutoSwimHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/AutoWalkHack.java b/src/main/java/net/wurstclient/hacks/AutoWalkHack.java index 01aaad06..99377bb3 100644 --- a/src/main/java/net/wurstclient/hacks/AutoWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoWalkHack.java @@ -25,13 +25,13 @@ public final class AutoWalkHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); IKeyBinding forwardKey = (IKeyBinding)MC.options.keyForward; forwardKey.setPressed(forwardKey.isActallyPressed()); diff --git a/src/main/java/net/wurstclient/hacks/BunnyHopHack.java b/src/main/java/net/wurstclient/hacks/BunnyHopHack.java index 5ee67aeb..f72ab1d9 100644 --- a/src/main/java/net/wurstclient/hacks/BunnyHopHack.java +++ b/src/main/java/net/wurstclient/hacks/BunnyHopHack.java @@ -38,13 +38,13 @@ public final class BunnyHopHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/DolphinHack.java b/src/main/java/net/wurstclient/hacks/DolphinHack.java index ebfa3f02..ffc407fc 100644 --- a/src/main/java/net/wurstclient/hacks/DolphinHack.java +++ b/src/main/java/net/wurstclient/hacks/DolphinHack.java @@ -27,14 +27,14 @@ public final class DolphinHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); WURST.getHax().fishHack.setEnabled(false); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/FastBreakHack.java b/src/main/java/net/wurstclient/hacks/FastBreakHack.java index 40fb37ad..c1b894f6 100644 --- a/src/main/java/net/wurstclient/hacks/FastBreakHack.java +++ b/src/main/java/net/wurstclient/hacks/FastBreakHack.java @@ -43,16 +43,15 @@ public final class FastBreakHack extends Hack @Override protected void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(BlockBreakingProgressListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(BlockBreakingProgressListener.class, this); } @Override protected void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(BlockBreakingProgressListener.class, - this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(BlockBreakingProgressListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/FastLadderHack.java b/src/main/java/net/wurstclient/hacks/FastLadderHack.java index d77b3333..e149d10d 100644 --- a/src/main/java/net/wurstclient/hacks/FastLadderHack.java +++ b/src/main/java/net/wurstclient/hacks/FastLadderHack.java @@ -26,13 +26,13 @@ public final class FastLadderHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/FastPlaceHack.java b/src/main/java/net/wurstclient/hacks/FastPlaceHack.java index e958fb4c..770df765 100644 --- a/src/main/java/net/wurstclient/hacks/FastPlaceHack.java +++ b/src/main/java/net/wurstclient/hacks/FastPlaceHack.java @@ -25,13 +25,13 @@ public final class FastPlaceHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/FishHack.java b/src/main/java/net/wurstclient/hacks/FishHack.java index cba83bb6..abba19fa 100644 --- a/src/main/java/net/wurstclient/hacks/FishHack.java +++ b/src/main/java/net/wurstclient/hacks/FishHack.java @@ -27,14 +27,14 @@ public final class FishHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); WURST.getHax().dolphinHack.setEnabled(false); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/FlightHack.java b/src/main/java/net/wurstclient/hacks/FlightHack.java index 6d678c07..9e481d1a 100644 --- a/src/main/java/net/wurstclient/hacks/FlightHack.java +++ b/src/main/java/net/wurstclient/hacks/FlightHack.java @@ -39,15 +39,15 @@ public final class FlightHack extends Hack @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(IsPlayerInWaterListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(IsPlayerInWaterListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(IsPlayerInWaterListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(IsPlayerInWaterListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index d23451d1..bfd3c972 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -56,15 +56,14 @@ public final class FreecamHack extends Hack @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(PacketOutputListener.class, this); - WURST.getEventManager().add(IsPlayerInWaterListener.class, this); - WURST.getEventManager().add(PlayerMoveListener.class, this); - WURST.getEventManager().add(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().add(IsNormalCubeListener.class, this); - WURST.getEventManager().add(SetOpaqueCubeListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(PacketOutputListener.class, this); + EVENTS.add(IsPlayerInWaterListener.class, this); + EVENTS.add(PlayerMoveListener.class, this); + EVENTS.add(CameraTransformViewBobbingListener.class, this); + EVENTS.add(IsNormalCubeListener.class, this); + EVENTS.add(SetOpaqueCubeListener.class, this); + EVENTS.add(RenderListener.class, this); fakePlayer = new FakePlayerEntity(); @@ -87,15 +86,14 @@ public final class FreecamHack extends Hack @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(PacketOutputListener.class, this); - WURST.getEventManager().remove(IsPlayerInWaterListener.class, this); - WURST.getEventManager().remove(PlayerMoveListener.class, this); - WURST.getEventManager().remove(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().remove(IsNormalCubeListener.class, this); - WURST.getEventManager().remove(SetOpaqueCubeListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(PacketOutputListener.class, this); + EVENTS.remove(IsPlayerInWaterListener.class, this); + EVENTS.remove(PlayerMoveListener.class, this); + EVENTS.remove(CameraTransformViewBobbingListener.class, this); + EVENTS.remove(IsNormalCubeListener.class, this); + EVENTS.remove(SetOpaqueCubeListener.class, this); + EVENTS.remove(RenderListener.class, this); fakePlayer.resetPlayerPosition(); fakePlayer.despawn(); diff --git a/src/main/java/net/wurstclient/hacks/FullbrightHack.java b/src/main/java/net/wurstclient/hacks/FullbrightHack.java index b7b1188e..c6407233 100644 --- a/src/main/java/net/wurstclient/hacks/FullbrightHack.java +++ b/src/main/java/net/wurstclient/hacks/FullbrightHack.java @@ -44,7 +44,7 @@ public final class FullbrightHack extends Hack implements UpdateListener addSetting(method); addSetting(fade); - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index c4f15125..55108bbc 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -62,10 +62,9 @@ public final class ItemEspHack extends Hack implements UpdateListener, @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(CameraTransformViewBobbingListener.class, this); + EVENTS.add(RenderListener.class, this); itemBox = GL11.glGenLists(1); GL11.glNewList(itemBox, GL11.GL_COMPILE); @@ -81,10 +80,9 @@ public final class ItemEspHack extends Hack implements UpdateListener, @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(CameraTransformViewBobbingListener.class, this); + EVENTS.remove(RenderListener.class, this); GL11.glDeleteLists(itemBox, 1); } diff --git a/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java b/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java index ebce9360..a6cb0add 100644 --- a/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java @@ -50,7 +50,7 @@ public final class ItemGeneratorHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); if(!MC.player.abilities.creativeMode) { @@ -62,7 +62,7 @@ public final class ItemGeneratorHack extends Hack implements UpdateListener @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/KillauraHack.java b/src/main/java/net/wurstclient/hacks/KillauraHack.java index 76089845..73cf9683 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraHack.java @@ -119,15 +119,15 @@ public final class KillauraHack extends Hack @Override protected void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(RenderListener.class, this); } @Override protected void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(RenderListener.class, this); target = null; } diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 0478756e..d05b194e 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -61,10 +61,9 @@ public final class MobEspHack extends Hack implements UpdateListener, @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(CameraTransformViewBobbingListener.class, this); + EVENTS.add(RenderListener.class, this); mobBox = GL11.glGenLists(1); GL11.glNewList(mobBox, GL11.GL_COMPILE); @@ -76,10 +75,9 @@ public final class MobEspHack extends Hack implements UpdateListener, @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(CameraTransformViewBobbingListener.class, this); + EVENTS.remove(RenderListener.class, this); GL11.glDeleteLists(mobBox, 1); mobBox = 0; diff --git a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java index 3db9e462..9cb93933 100644 --- a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java @@ -74,17 +74,17 @@ public final class MobSpawnEspHack extends Hack { pool = MinPriorityThreadFactory.newFixedThreadPool(); - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(PacketInputListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(PacketInputListener.class, this); + EVENTS.add(RenderListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(PacketInputListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(PacketInputListener.class, this); + EVENTS.remove(RenderListener.class, this); for(ChunkScanner scanner : new ArrayList<>(scanners.values())) { diff --git a/src/main/java/net/wurstclient/hacks/NoFallHack.java b/src/main/java/net/wurstclient/hacks/NoFallHack.java index 3ee5353f..0383fbbb 100644 --- a/src/main/java/net/wurstclient/hacks/NoFallHack.java +++ b/src/main/java/net/wurstclient/hacks/NoFallHack.java @@ -26,13 +26,13 @@ public final class NoFallHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/NukerHack.java b/src/main/java/net/wurstclient/hacks/NukerHack.java index 7b8075b8..e87ecd2f 100644 --- a/src/main/java/net/wurstclient/hacks/NukerHack.java +++ b/src/main/java/net/wurstclient/hacks/NukerHack.java @@ -85,17 +85,17 @@ public final class NukerHack extends Hack @Override protected void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(LeftClickListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(LeftClickListener.class, this); + EVENTS.add(RenderListener.class, this); } @Override protected void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(LeftClickListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(LeftClickListener.class, this); + EVENTS.remove(RenderListener.class, this); if(currentBlock != null) { diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index 8878b026..c783d887 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -69,10 +69,9 @@ public final class PlayerEspHack extends Hack implements UpdateListener, @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(CameraTransformViewBobbingListener.class, this); + EVENTS.add(RenderListener.class, this); playerBox = GL11.glGenLists(1); GL11.glNewList(playerBox, GL11.GL_COMPILE); @@ -84,10 +83,9 @@ public final class PlayerEspHack extends Hack implements UpdateListener, @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(CameraTransformViewBobbingListener.class, - this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(CameraTransformViewBobbingListener.class, this); + EVENTS.remove(RenderListener.class, this); GL11.glDeleteLists(playerBox, 1); playerBox = 0; diff --git a/src/main/java/net/wurstclient/hacks/SearchHack.java b/src/main/java/net/wurstclient/hacks/SearchHack.java index 89b4a979..98aee7f8 100644 --- a/src/main/java/net/wurstclient/hacks/SearchHack.java +++ b/src/main/java/net/wurstclient/hacks/SearchHack.java @@ -110,17 +110,17 @@ public final class SearchHack extends Hack displayList = GL11.glGenLists(1); displayListUpToDate = false; - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(PacketInputListener.class, this); - WURST.getEventManager().add(RenderListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(PacketInputListener.class, this); + EVENTS.add(RenderListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(PacketInputListener.class, this); - WURST.getEventManager().remove(RenderListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(PacketInputListener.class, this); + EVENTS.remove(RenderListener.class, this); stopPool2Tasks(); pool1.shutdownNow(); diff --git a/src/main/java/net/wurstclient/hacks/SneakHack.java b/src/main/java/net/wurstclient/hacks/SneakHack.java index 8237dab0..5cdb49d3 100644 --- a/src/main/java/net/wurstclient/hacks/SneakHack.java +++ b/src/main/java/net/wurstclient/hacks/SneakHack.java @@ -44,15 +44,15 @@ public final class SneakHack extends Hack @Override public void onEnable() { - WURST.getEventManager().add(PreMotionListener.class, this); - WURST.getEventManager().add(PostMotionListener.class, this); + EVENTS.add(PreMotionListener.class, this); + EVENTS.add(PostMotionListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(PreMotionListener.class, this); - WURST.getEventManager().remove(PostMotionListener.class, this); + EVENTS.remove(PreMotionListener.class, this); + EVENTS.remove(PostMotionListener.class, this); switch(mode.getSelected()) { diff --git a/src/main/java/net/wurstclient/hacks/SpiderHack.java b/src/main/java/net/wurstclient/hacks/SpiderHack.java index 44e95a78..8dd21307 100644 --- a/src/main/java/net/wurstclient/hacks/SpiderHack.java +++ b/src/main/java/net/wurstclient/hacks/SpiderHack.java @@ -24,13 +24,13 @@ public final class SpiderHack extends Hack implements UpdateListener @Override public void onEnable() { - WURST.getEventManager().add(UpdateListener.class, this); + EVENTS.add(UpdateListener.class, this); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); + EVENTS.remove(UpdateListener.class, this); } @Override diff --git a/src/main/java/net/wurstclient/hacks/XRayHack.java b/src/main/java/net/wurstclient/hacks/XRayHack.java index bf64dce6..b72bfad9 100644 --- a/src/main/java/net/wurstclient/hacks/XRayHack.java +++ b/src/main/java/net/wurstclient/hacks/XRayHack.java @@ -70,26 +70,24 @@ public final class XRayHack extends Hack implements UpdateListener, { oreNames = new ArrayList<>(ores.getBlockNames()); - WURST.getEventManager().add(UpdateListener.class, this); - WURST.getEventManager().add(SetOpaqueCubeListener.class, this); - WURST.getEventManager().add(GetAmbientOcclusionLightLevelListener.class, - this); - WURST.getEventManager().add(ShouldDrawSideListener.class, this); - WURST.getEventManager().add(TesselateBlockListener.class, this); - WURST.getEventManager().add(RenderBlockEntityListener.class, this); + EVENTS.add(UpdateListener.class, this); + EVENTS.add(SetOpaqueCubeListener.class, this); + EVENTS.add(GetAmbientOcclusionLightLevelListener.class, this); + EVENTS.add(ShouldDrawSideListener.class, this); + EVENTS.add(TesselateBlockListener.class, this); + EVENTS.add(RenderBlockEntityListener.class, this); MC.worldRenderer.reload(); } @Override public void onDisable() { - WURST.getEventManager().remove(UpdateListener.class, this); - WURST.getEventManager().remove(SetOpaqueCubeListener.class, this); - WURST.getEventManager() - .remove(GetAmbientOcclusionLightLevelListener.class, this); - WURST.getEventManager().remove(ShouldDrawSideListener.class, this); - WURST.getEventManager().remove(TesselateBlockListener.class, this); - WURST.getEventManager().remove(RenderBlockEntityListener.class, this); + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(SetOpaqueCubeListener.class, this); + EVENTS.remove(GetAmbientOcclusionLightLevelListener.class, this); + EVENTS.remove(ShouldDrawSideListener.class, this); + EVENTS.remove(TesselateBlockListener.class, this); + EVENTS.remove(RenderBlockEntityListener.class, this); MC.worldRenderer.reload(); if(!WURST.getHax().fullbrightHack.isEnabled())