diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-10 17:17:38 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-10 17:17:38 +0200 |
commit | 5911d7be04be37bf1c7e781daf0c3031e3af7e94 (patch) | |
tree | be36e3effcd873bb0172ad5d18c88b476ac1d527 /src/main/java/cc/polyfrost/oneconfig/internal | |
parent | 1394e5344582ee05f31fb491c2cf2b0d160c3201 (diff) | |
parent | 3aa1e46c963a015906e72d7ae0b4f2ba6a0dbc58 (diff) | |
download | OneConfig-5911d7be04be37bf1c7e781daf0c3031e3af7e94.tar.gz OneConfig-5911d7be04be37bf1c7e781daf0c3031e3af7e94.tar.bz2 OneConfig-5911d7be04be37bf1c7e781daf0c3031e3af7e94.zip |
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal')
7 files changed, 20 insertions, 19 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java index 51e3a6f..948f4ec 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java @@ -63,8 +63,8 @@ public class OneConfig { testConfig = new TestConfig(); CommandManager.INSTANCE.registerCommand(OneConfigCommand.class); CommandManager.INSTANCE.registerCommand(TestCommand.class); - EventManager.INSTANCE.register(new HudCore()); - EventManager.INSTANCE.register(HypixelUtils.INSTANCE); + EventManager.getEventManager().register(new HudCore()); + EventManager.getEventManager().register(HypixelUtils.INSTANCE); reloadModsList(); initialized = true; } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java b/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java index f5c332f..d248df8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java @@ -22,15 +22,15 @@ import java.util.List; /** * An implementation of the BlurMC mod by tterrag1098. * <p> - * For the original source see https://github.com/tterrag1098/Blur/blob/1.8.9/src/main/java/com/tterrag/blur/Blur.java - * For the public license, see https://github.com/tterrag1098/Blur/blob/1.8.9/LICENSE + * For the original source see <a href="https://github.com/tterrag1098/Blur/blob/1.8.9/src/main/java/com/tterrag/blur/Blur.java">...</a> + * For the public license, see <a href="https://github.com/tterrag1098/Blur/blob/1.8.9/LICENSE">...</a> * <p> - * License available under https://github.com/boomboompower/ToggleChat/blob/master/src/main/resources/licenses/BlurMC-License.txt + * License available under <a href="https://github.com/boomboompower/ToggleChat/blob/master/src/main/resources/licenses/BlurMC-License.txt">...</a> * * @author tterrag1098, boomboompower * <p> * Taken from ToggleChat - * https://github.com/boomboompower/ToggleChat/blob/master/LICENSE + * <a href="https://github.com/boomboompower/ToggleChat/blob/master/LICENSE">...</a> */ public class BlurHandler { public static BlurHandler INSTANCE = new BlurHandler(); @@ -43,7 +43,7 @@ public class BlurHandler { * Simply initializes the blur mod so events are properly handled by forge. */ public void load() { - EventManager.INSTANCE.register(this); + EventManager.getEventManager().register(this); } @Subscribe diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java index f08d37e..8422e1e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java @@ -12,6 +12,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public class GuiIngameForgeMixin { @Inject(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/GuiIngameForge;post(Lnet/minecraftforge/client/event/RenderGameOverlayEvent$ElementType;)V", shift = At.Shift.AFTER, remap = false), remap = true) private void onRenderGameOverlay(float partialTicks, CallbackInfo ci) { - EventManager.INSTANCE.post(new HudRenderEvent(partialTicks)); + EventManager.getEventManager().post(new HudRenderEvent(partialTicks)); } } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java index f0d201c..6456cf9 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java @@ -27,27 +27,28 @@ public class MinecraftMixin { @Inject(method = "startGame", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/FMLClientHandler;onInitializationComplete()V", shift = At.Shift.AFTER, remap = false), remap = true) private void onInit(CallbackInfo ci) { + EventManager.getEventManager().post(new InitializationEvent()); OneConfig.init(); } @Inject(method = "runGameLoop", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;onRenderTickStart(F)V", shift = At.Shift.AFTER, remap = false), remap = true) private void onRenderTickStart(CallbackInfo ci) { - EventManager.INSTANCE.post(new RenderEvent(Stage.START, timer.renderPartialTicks)); + EventManager.getEventManager().post(new RenderEvent(Stage.START, timer.renderPartialTicks)); } @Inject(method = "runGameLoop", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;onRenderTickEnd(F)V", shift = At.Shift.AFTER, remap = false), remap = true) private void onRenderTickEnd(CallbackInfo ci) { - EventManager.INSTANCE.post(new RenderEvent(Stage.END, timer.renderPartialTicks)); + EventManager.getEventManager().post(new RenderEvent(Stage.END, timer.renderPartialTicks)); } @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;onPreClientTick()V", shift = At.Shift.AFTER, remap = false), remap = true) private void onClientTickStart(CallbackInfo ci) { - EventManager.INSTANCE.post(new TickEvent(Stage.START)); + EventManager.getEventManager().post(new TickEvent(Stage.START)); } @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;onPostClientTick()V", shift = At.Shift.AFTER, remap = false), remap = true) private void onClientTickEnd(CallbackInfo ci) { - EventManager.INSTANCE.post(new TickEvent(Stage.END)); + EventManager.getEventManager().post(new TickEvent(Stage.END)); } @ModifyArg(method = "displayGuiScreen", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/eventhandler/EventBus;post(Lnet/minecraftforge/fml/common/eventhandler/Event;)Z", remap = false), remap = true) @@ -55,7 +56,7 @@ public class MinecraftMixin { if (a instanceof GuiOpenEvent) { GuiOpenEvent forgeEvent = (GuiOpenEvent) a; ScreenOpenEvent event = new ScreenOpenEvent(forgeEvent.gui); - EventManager.INSTANCE.post(event); + EventManager.getEventManager().post(event); if (event.isCancelled) { forgeEvent.setCanceled(true); } @@ -66,11 +67,11 @@ public class MinecraftMixin { @Inject(method = "runGameLoop", at = @At(value = "FIELD", target = "Lnet/minecraft/util/Timer;renderPartialTicks:F", opcode = Opcodes.PUTFIELD, shift = At.Shift.AFTER)) private void onNonDeltaTickTimerUpdate(CallbackInfo ci) { - EventManager.INSTANCE.post(new TimerUpdateEvent(timer, false)); + EventManager.getEventManager().post(new TimerUpdateEvent(timer, false)); } @Inject(method = "runGameLoop", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Timer;updateTimer()V", shift = At.Shift.AFTER, ordinal = 1)) private void onDeltaTickTimerUpdate(CallbackInfo ci) { - EventManager.INSTANCE.post(new TimerUpdateEvent(timer, true)); + EventManager.getEventManager().post(new TimerUpdateEvent(timer, true)); } } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetHandlerPlayClientMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetHandlerPlayClientMixin.java index 877d540..0673c77 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetHandlerPlayClientMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetHandlerPlayClientMixin.java @@ -17,7 +17,7 @@ public class NetHandlerPlayClientMixin { @Inject(method = "addToSendQueue", at = @At("HEAD"), cancellable = true) private void onSendPacket(Packet<?> p_147297_1_, CallbackInfo ci) { SendPacketEvent event = new SendPacketEvent(p_147297_1_); - EventManager.INSTANCE.post(event); + EventManager.getEventManager().post(event); if (event.isCancelled) { ci.cancel(); } @@ -27,7 +27,7 @@ public class NetHandlerPlayClientMixin { private void onClientChat(S02PacketChat packetIn, CallbackInfo ci) { if (packetIn.getType() == 0) { ChatReceiveEvent event = new ChatReceiveEvent(packetIn.getChatComponent()); - EventManager.INSTANCE.post(event); + EventManager.getEventManager().post(event); if (event.isCancelled) { ci.cancel(); } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetworkManagerMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetworkManagerMixin.java index 51988f2..89346f6 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetworkManagerMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetworkManagerMixin.java @@ -15,7 +15,7 @@ public class NetworkManagerMixin { @Inject(method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true) private void onReceivePacket(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_, CallbackInfo ci) { ReceivePacketEvent event = new ReceivePacketEvent(p_channelRead0_2_); - EventManager.INSTANCE.post(event); + EventManager.getEventManager().post(event); if (event.isCancelled) { ci.cancel(); } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/WorldClientMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/WorldClientMixin.java index d1fce6a..5e9b1bc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/WorldClientMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/WorldClientMixin.java @@ -16,6 +16,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public class WorldClientMixin { @Inject(method = "<init>", at = @At("RETURN")) private void onWorldLoad(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_, CallbackInfo ci) { - EventManager.INSTANCE.post(new WorldLoadEvent()); + EventManager.getEventManager().post(new WorldLoadEvent()); } } |