diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-11 10:30:06 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-11 10:30:06 +0200 |
commit | 1ab7422957a76158883e0449ed593ac216c9ef80 (patch) | |
tree | eb3bb5434a1b860941f85d2fdb543264d094f2de /src/main/java/cc/polyfrost/oneconfig/internal | |
parent | d888d6b7358226792bf0cedbe67c7bb26204983f (diff) | |
parent | f3aac4876936dc58e6251bffae4a203d7b964051 (diff) | |
download | OneConfig-1ab7422957a76158883e0449ed593ac216c9ef80.tar.gz OneConfig-1ab7422957a76158883e0449ed593ac216c9ef80.tar.bz2 OneConfig-1ab7422957a76158883e0449ed593ac216c9ef80.zip |
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal')
9 files changed, 27 insertions, 21 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java index 389e200..b3c6823 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java @@ -58,8 +58,8 @@ public class OneConfig { GuiUtils.getDeltaTime(); // called to make sure static initializer is called BlurHandler.INSTANCE.load(); CommandManager.INSTANCE.registerCommand(OneConfigCommand.class); - EventManager.getEventManager().register(new HudCore()); - EventManager.getEventManager().register(HypixelUtils.INSTANCE); + EventManager.INSTANCE.register(new HudCore()); + EventManager.INSTANCE.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 d248df8..4aa94d9 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java @@ -6,9 +6,9 @@ import cc.polyfrost.oneconfig.events.event.ScreenOpenEvent; import cc.polyfrost.oneconfig.events.event.Stage; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.internal.mixin.ShaderGroupAccessor; -import gg.essential.universal.UMinecraft; -import gg.essential.universal.UScreen; -import me.kbrewster.eventbus.Subscribe; +import cc.polyfrost.oneconfig.libs.universal.UMinecraft; +import cc.polyfrost.oneconfig.libs.universal.UScreen; +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.shader.Shader; @@ -43,7 +43,7 @@ public class BlurHandler { * Simply initializes the blur mod so events are properly handled by forge. */ public void load() { - EventManager.getEventManager().register(this); + EventManager.INSTANCE.register(this); } @Subscribe diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java index 7c92799..04a5e69 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java @@ -2,8 +2,8 @@ package cc.polyfrost.oneconfig.internal.hud; import cc.polyfrost.oneconfig.events.event.HudRenderEvent; import cc.polyfrost.oneconfig.hud.BasicHud; -import gg.essential.universal.UResolution; -import me.kbrewster.eventbus.Subscribe; +import cc.polyfrost.oneconfig.libs.universal.UResolution; +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; import java.util.ArrayList; 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 8422e1e..f08d37e 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.getEventManager().post(new HudRenderEvent(partialTicks)); + EventManager.INSTANCE.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 6456cf9..8a28bed 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java @@ -27,28 +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()); + EventManager.INSTANCE.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.getEventManager().post(new RenderEvent(Stage.START, timer.renderPartialTicks)); + EventManager.INSTANCE.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.getEventManager().post(new RenderEvent(Stage.END, timer.renderPartialTicks)); + EventManager.INSTANCE.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.getEventManager().post(new TickEvent(Stage.START)); + EventManager.INSTANCE.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.getEventManager().post(new TickEvent(Stage.END)); + EventManager.INSTANCE.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) @@ -56,7 +56,7 @@ public class MinecraftMixin { if (a instanceof GuiOpenEvent) { GuiOpenEvent forgeEvent = (GuiOpenEvent) a; ScreenOpenEvent event = new ScreenOpenEvent(forgeEvent.gui); - EventManager.getEventManager().post(event); + EventManager.INSTANCE.post(event); if (event.isCancelled) { forgeEvent.setCanceled(true); } @@ -67,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.getEventManager().post(new TimerUpdateEvent(timer, false)); + EventManager.INSTANCE.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.getEventManager().post(new TimerUpdateEvent(timer, true)); + EventManager.INSTANCE.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 0673c77..877d540 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.getEventManager().post(event); + EventManager.INSTANCE.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.getEventManager().post(event); + EventManager.INSTANCE.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 89346f6..51988f2 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.getEventManager().post(event); + EventManager.INSTANCE.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 5e9b1bc..d1fce6a 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.getEventManager().post(new WorldLoadEvent()); + EventManager.INSTANCE.post(new WorldLoadEvent()); } } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/package-info.java b/src/main/java/cc/polyfrost/oneconfig/internal/package-info.java new file mode 100644 index 0000000..4a8a6a5 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/internal/package-info.java @@ -0,0 +1,6 @@ +/** + * The package where all internal OneConfig shenanigans go on. + * This package is hidden from devs and is subject to change at any time with no warning. + * <p><b>It is recommended you do not interact with this package in any way.</b></p> + */ +package cc.polyfrost.oneconfig.internal;
\ No newline at end of file |