diff options
Diffstat (limited to 'src/main')
30 files changed, 69 insertions, 71 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java index d455411..d62247c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.config.core; -import gg.essential.universal.UKeyboard; +import cc.polyfrost.oneconfig.libs.universal.UKeyboard; import java.util.ArrayList; diff --git a/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java b/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java index 05bb196..8492806 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.events; -import me.kbrewster.eventbus.EventBus; -import me.kbrewster.eventbus.invokers.LMFInvoker; +import cc.polyfrost.oneconfig.libs.eventbus.EventBus; +import cc.polyfrost.oneconfig.libs.eventbus.invokers.LMFInvoker; /** * Manages all events from OneConfig. @@ -10,13 +10,9 @@ public final class EventManager { /** * The instance of the {@link EventManager}. */ - private static final EventManager INSTANCE = new EventManager(); + public static final EventManager INSTANCE = new EventManager(); private final EventBus eventBus = new EventBus(new LMFInvoker(), Throwable::printStackTrace); - public static EventManager getEventManager() { - return INSTANCE; - } - private EventManager() { } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java index 13174ab..939bbaa 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java @@ -4,9 +4,9 @@ import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; import cc.polyfrost.oneconfig.hud.BasicHud; import cc.polyfrost.oneconfig.internal.hud.HudCore; import cc.polyfrost.oneconfig.renderer.RenderManager; -import gg.essential.universal.UKeyboard; -import gg.essential.universal.UMatrixStack; -import gg.essential.universal.UScreen; +import cc.polyfrost.oneconfig.libs.universal.UKeyboard; +import cc.polyfrost.oneconfig.libs.universal.UMatrixStack; +import cc.polyfrost.oneconfig.libs.universal.UScreen; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java index 07a60ee..3172336 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java @@ -17,10 +17,10 @@ import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; -import gg.essential.universal.UKeyboard; -import gg.essential.universal.UMatrixStack; -import gg.essential.universal.UResolution; -import gg.essential.universal.UScreen; +import cc.polyfrost.oneconfig.libs.universal.UKeyboard; +import cc.polyfrost.oneconfig.libs.universal.UMatrixStack; +import cc.polyfrost.oneconfig.libs.universal.UResolution; +import cc.polyfrost.oneconfig.libs.universal.UScreen; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.lwjgl.input.Mouse; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java index 893d628..e5d187f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -14,7 +14,7 @@ import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import cc.polyfrost.oneconfig.utils.color.ColorUtils; -import gg.essential.universal.wrappers.UPlayer; +import cc.polyfrost.oneconfig.libs.universal.wrappers.UPlayer; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.fml.common.ModMetadata; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java index 5c239c0..b7d1a68 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java @@ -10,7 +10,7 @@ import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.utils.color.ColorPalette; -import gg.essential.universal.UKeyboard; +import cc.polyfrost.oneconfig.libs.universal.UKeyboard; import java.lang.reflect.Field; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java index 559b2b2..a43b969 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java @@ -10,7 +10,7 @@ import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.MathUtils; import cc.polyfrost.oneconfig.utils.TextUtils; -import gg.essential.universal.UKeyboard; +import cc.polyfrost.oneconfig.libs.universal.UKeyboard; import org.jetbrains.annotations.NotNull; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java index 29c6d89..738ed21 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.hud; import cc.polyfrost.oneconfig.renderer.RenderManager; -import gg.essential.universal.UMinecraft; +import cc.polyfrost.oneconfig.libs.universal.UMinecraft; import java.util.List; 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/renderer/RenderManager.java b/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java index 7ab39e0..765a595 100644 --- a/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java @@ -10,9 +10,9 @@ import cc.polyfrost.oneconfig.internal.assets.Images; import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.NetworkUtils; -import gg.essential.universal.UGraphics; -import gg.essential.universal.UMinecraft; -import gg.essential.universal.UResolution; +import cc.polyfrost.oneconfig.libs.universal.UGraphics; +import cc.polyfrost.oneconfig.libs.universal.UMinecraft; +import cc.polyfrost.oneconfig.libs.universal.UResolution; import net.minecraft.client.gui.Gui; import net.minecraft.client.shader.Framebuffer; import org.lwjgl.nanovg.NVGColor; diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java index 31a503b..b4a1d9e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestCommand_Test.java @@ -4,7 +4,7 @@ import cc.polyfrost.oneconfig.utils.commands.annotations.Command; import cc.polyfrost.oneconfig.utils.commands.annotations.Main; import cc.polyfrost.oneconfig.utils.commands.annotations.Name; import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand; -import gg.essential.universal.UChat; +import cc.polyfrost.oneconfig.libs.universal.UChat; @Command(value = "test", aliases = {"t"}) public class TestCommand_Test { diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java index aee6d6b..296bf99 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java @@ -7,7 +7,7 @@ import cc.polyfrost.oneconfig.config.data.*; import cc.polyfrost.oneconfig.config.Config; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.config.migration.VigilanceMigrator; -import gg.essential.universal.UKeyboard; +import cc.polyfrost.oneconfig.libs.universal.UKeyboard; import net.minecraftforge.fml.common.FMLCommonHandler; public class TestConfig_Test extends Config { diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java index 5ad95c7..12a8735 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java @@ -2,8 +2,8 @@ package cc.polyfrost.oneconfig.test; import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.renderer.font.Fonts; -import gg.essential.universal.UMatrixStack; -import gg.essential.universal.UScreen; +import cc.polyfrost.oneconfig.libs.universal.UMatrixStack; +import cc.polyfrost.oneconfig.libs.universal.UScreen; import org.jetbrains.annotations.NotNull; import java.awt.*; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java index 7ec5ee5..0f50a33 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java @@ -1,14 +1,14 @@ package cc.polyfrost.oneconfig.utils; import cc.polyfrost.oneconfig.gui.OneConfigGui; -import gg.essential.universal.UResolution; +import cc.polyfrost.oneconfig.libs.universal.UResolution; import org.lwjgl.input.Mouse; /** * Various utility methods for input. * <p> * All values returned from this class are not scaled to Minecraft's GUI scale. - * For scaled values, see {@link gg.essential.universal.UMouse}. + * For scaled values, see {@link cc.polyfrost.oneconfig.libs.universal.UMouse}. * </p> */ public final class InputUtils { @@ -78,7 +78,7 @@ public final class InputUtils { * Gets the current mouse X position. * <p> * All values returned from this class are not scaled to Minecraft's GUI scale. - * For scaled values, see {@link gg.essential.universal.UMouse}. + * For scaled values, see {@link cc.polyfrost.oneconfig.libs.universal.UMouse}. * </p> * * @return the current mouse X position @@ -92,7 +92,7 @@ public final class InputUtils { * Gets the current mouse Y position. * <p> * All values returned from this class are not scaled to Minecraft's GUI scale. - * For scaled values, see {@link gg.essential.universal.UMouse}. + * For scaled values, see {@link cc.polyfrost.oneconfig.libs.universal.UMouse}. * </p> * * @return the current mouse Y position diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java index 5578e1e..b99d096 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.utils; import com.google.gson.JsonElement; -import gg.essential.universal.UDesktop; +import cc.polyfrost.oneconfig.libs.universal.UDesktop; import org.apache.commons.io.IOUtils; import java.io.*; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/TickDelay.java b/src/main/java/cc/polyfrost/oneconfig/utils/TickDelay.java index 6cda00c..b51ee85 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/TickDelay.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/TickDelay.java @@ -3,7 +3,7 @@ package cc.polyfrost.oneconfig.utils; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.Stage; import cc.polyfrost.oneconfig.events.event.TickEvent; -import me.kbrewster.eventbus.Subscribe; +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; /** * Schedules a Runnable to be called after a certain amount of ticks. @@ -13,7 +13,7 @@ public class TickDelay { private int delay; public TickDelay(Runnable functionName, int ticks) { - EventManager.getEventManager().register(this); + EventManager.INSTANCE.register(this); delay = ticks; function = functionName; } @@ -24,7 +24,7 @@ public class TickDelay { // Delay expired if (delay < 1) { function.run(); - EventManager.getEventManager().unregister(this); + EventManager.INSTANCE.unregister(this); } delay--; } diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java index 32bbf5d..338e9a3 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java @@ -5,8 +5,8 @@ import cc.polyfrost.oneconfig.utils.commands.annotations.Greedy; import cc.polyfrost.oneconfig.utils.commands.annotations.Main; import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand; import cc.polyfrost.oneconfig.utils.commands.arguments.*; -import gg.essential.universal.ChatColor; -import gg.essential.universal.UChat; +import cc.polyfrost.oneconfig.libs.universal.ChatColor; +import cc.polyfrost.oneconfig.libs.universal.UChat; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraftforge.client.ClientCommandHandler; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/gui/GuiUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/gui/GuiUtils.java index c80814f..d7b3bea 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/gui/GuiUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/gui/GuiUtils.java @@ -4,9 +4,9 @@ import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.RenderEvent; import cc.polyfrost.oneconfig.events.event.Stage; import cc.polyfrost.oneconfig.utils.TickDelay; -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.gui.GuiScreen; /** @@ -17,7 +17,7 @@ public final class GuiUtils { private static long deltaTime = 17L; static { - EventManager.getEventManager().register(new GuiUtils()); + EventManager.INSTANCE.register(new GuiUtils()); } /** diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/gui/OneUIScreen.java b/src/main/java/cc/polyfrost/oneconfig/utils/gui/OneUIScreen.java index c06f6f3..7459224 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/gui/OneUIScreen.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/gui/OneUIScreen.java @@ -2,8 +2,8 @@ package cc.polyfrost.oneconfig.utils.gui; import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.utils.InputUtils; -import gg.essential.universal.UMatrixStack; -import gg.essential.universal.UScreen; +import cc.polyfrost.oneconfig.libs.universal.UMatrixStack; +import cc.polyfrost.oneconfig.libs.universal.UScreen; import net.minecraft.client.gui.GuiScreen; import org.jetbrains.annotations.NotNull; import org.lwjgl.input.Mouse; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/hypixel/HypixelUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/hypixel/HypixelUtils.java index 36dc46c..df5211b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/hypixel/HypixelUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/hypixel/HypixelUtils.java @@ -8,11 +8,11 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import gg.essential.universal.UChat; -import gg.essential.universal.UMinecraft; -import gg.essential.universal.wrappers.UPlayer; -import gg.essential.universal.wrappers.message.UTextComponent; -import me.kbrewster.eventbus.Subscribe; +import cc.polyfrost.oneconfig.libs.universal.UChat; +import cc.polyfrost.oneconfig.libs.universal.UMinecraft; +import cc.polyfrost.oneconfig.libs.universal.wrappers.UPlayer; +import cc.polyfrost.oneconfig.libs.universal.wrappers.message.UTextComponent; +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; import java.util.Locale; import java.util.concurrent.TimeUnit; @@ -123,7 +123,7 @@ public class HypixelUtils { previousLocraw = parsed; inGame = true; // If your gamemode does not return "lobby", boolean inGame is true. } - EventManager.getEventManager().post(new LocrawEvent(locraw)); + EventManager.INSTANCE.post(new LocrawEvent(locraw)); event.isCancelled = true; } } catch (Exception ex) { diff --git a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt index cd0596e..c8c18e4 100644 --- a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt +++ b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/DSLs.kt @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.utils.dsl -import gg.essential.universal.UMinecraft +import cc.polyfrost.oneconfig.libs.universal.UMinecraft /** * Gets the current [net.minecraft.client.Minecraft] instance. diff --git a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/NetworkUtilsDSL.kt b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/NetworkUtilsDSL.kt index 7ce6c93..4e8bca8 100644 --- a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/NetworkUtilsDSL.kt +++ b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/NetworkUtilsDSL.kt @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.utils.dsl import cc.polyfrost.oneconfig.utils.NetworkUtils -import gg.essential.universal.UDesktop +import cc.polyfrost.oneconfig.libs.universal.UDesktop import java.io.File /** diff --git a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt index 0000fc1..21c33f0 100644 --- a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt +++ b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt @@ -42,6 +42,8 @@ fun nanoVG(mcScaling: Boolean = false, block: VG.() -> Unit) = RenderManager.set ) } +fun nanoVG(context: Long, block: VG.() -> Unit) = block.invoke(VG(context)) + fun Long.drawRect(x: Number, y: Number, width: Number, height: Number, color: Int, bypassOneConfig: Boolean = false) = if (bypassOneConfig) { |