diff options
| author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-21 04:04:48 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-20 20:04:48 +0100 |
| commit | f06946c01b2c8f210b398a16610c260eca093a8b (patch) | |
| tree | 22bda7a5e9b0a1e7370ff2b1e74fc7c9e4035379 /versions | |
| parent | ff2ead62333e90b61e05c8cb6a91f692fcf30805 (diff) | |
| download | OneConfig-f06946c01b2c8f210b398a16610c260eca093a8b.tar.gz OneConfig-f06946c01b2c8f210b398a16610c260eca093a8b.tar.bz2 OneConfig-f06946c01b2c8f210b398a16610c260eca093a8b.zip | |
HUD Improvements, 1.16 port, fix NanoVG with ARM (#52)
* egg 1
* separate Hud from background stuff
* 1984
This reverts commit 9ae517d57bbd495d30d35cb1cbfe81a03556e6bd.
* hitboxes woo!!!!!
* Revert "hitboxes woo!!!!!"
This reverts commit 405d32d17df3c83f2e79eddf0de853f7279767a6.
* padding
* allow position to go slightly off the screen
* stop using ints for ABSOLUTELY EVERYTHING, DIAMOND ...
fix vigilance compat not setting color
* start on new pos system
* some stuff
* finish new position system
* api momento
* 1.16.2 fabric port
* start on hud gui
* temp remove 1.16.2 fabric since it doesn't compile
* fix fabric build
* hud gui stuff
* apiDump
* fix fabric build 2
* so true
* selecting stuff
* scaling + other small things
* More protecting
* fix nanovg not working with macOS ARM
move OneConfig.preLaunch to OneConfigInit
* clean up OneUIScreen
make kotlin version of TestNanoVGGui
* make keybinds have runnable by default
* rollback keybind things
* merge master into hud-improvements (#55)
* Release workflow (#53)
* release workflow
* update normal version to hash
* fix
* fix naming
* fix some stuff
* fix version thing
* switch to number from hash
* Release workflow (#54)
* release workflow
* update normal version to hash
* fix
* fix naming
* fix some stuff
* fix version thing
* switch to number from hash
* Maybe epic fixo
* gotta love those Java principles
* Revert "gotta love those Java principles", wrong branch
This reverts commit 333d8b2ad8941790c13c4bfe0777fbd203d463e5.
* start on snapping
* Finish snapping
* stop including mixin by default on legacy versions
this breaks builds if the mod itself does not use mixin
* merge draw and drawExample
* fix gradle publish
* Some fixes
* Api DUmpidy
* Help subcommand impovments (#59)
* Made the overall look of the "help" subcommand better + added the ability to change the colour for the command overall + each individual SubCommand
* Made the alliases show batter + added support for to show subcommand aliasses
* mr deliverer didnt reply but whatever, added a space between command/subcommand and alliasses
Co-authored-by: pinkulu <pinkulumc@gmail.com>
* fix file not overwriting
toJavaColor
* Fix full shadow not scaling correctly
Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Co-authored-by: nxtdaydelivery <12willettsh@gmail.com>
Co-authored-by: pinkulu <56201697+pinkulu@users.noreply.github.com>
Co-authored-by: pinkulu <pinkulumc@gmail.com>
Diffstat (limited to 'versions')
50 files changed, 1079 insertions, 172 deletions
diff --git a/versions/1.12.2-1.16.2.txt b/versions/1.12.2-1.16.2.txt index 5d0f09b..68a6805 100644 --- a/versions/1.12.2-1.16.2.txt +++ b/versions/1.12.2-1.16.2.txt @@ -27,4 +27,6 @@ org.spongepowered.asm.lib.tree.FieldInsnNode org.objectweb.asm.tree.FieldInsnNod org.spongepowered.asm.lib.tree.MethodInsnNode org.objectweb.asm.tree.MethodInsnNode org.spongepowered.asm.lib.tree.InsnList org.objectweb.asm.tree.InsnList org.spongepowered.asm.lib.tree.InsnNode org.objectweb.asm.tree.InsnNode -org.spongepowered.asm.lib.tree.JumpInsnNode org.objectweb.asm.tree.JumpInsnNode
\ No newline at end of file +org.spongepowered.asm.lib.tree.JumpInsnNode org.objectweb.asm.tree.JumpInsnNode + +org.lwjgl.nanovg.NanoVGGL2 org.lwjgl.nanovg.NanoVGGL3
\ No newline at end of file diff --git a/versions/1.12.2-forge/api/1.12.2-forge.api b/versions/1.12.2-forge/api/1.12.2-forge.api index b073db3..a948ea0 100644 --- a/versions/1.12.2-forge/api/1.12.2-forge.api +++ b/versions/1.12.2-forge/api/1.12.2-forge.api @@ -64,8 +64,28 @@ public class cc/polyfrost/oneconfig/platform/impl/MousePlatformImpl : cc/polyfro public fun isButtonDown (I)Z } +public class cc/polyfrost/oneconfig/platform/impl/NanoVGPlatformImpl : cc/polyfrost/oneconfig/platform/NanoVGPlatform { + public fun <init> ()V + public fun nnvgCreate (I)J + public fun nnvgDelete (J)V + public fun nnvglCreateImageFromHandle (JIIII)I + public fun nnvglImageHandle (JI)I + public fun nnvgluBindFramebuffer (JJ)V + public fun nnvgluCreateFramebuffer (JIII)J + public fun nnvgluDeleteFramebuffer (JJ)V + public fun nvgCreate (I)J + public fun nvgDelete (J)V + public fun nvglCreateImageFromHandle (JIIII)I + public fun nvglImageHandle (JI)I + public fun nvgluBindFramebuffer (JLorg/lwjgl/nanovg/NVGLUFramebuffer;)V + public fun nvgluCreateFramebuffer (JIII)Lorg/lwjgl/nanovg/NVGLUFramebuffer; + public fun nvgluDeleteFramebuffer (JLorg/lwjgl/nanovg/NVGLUFramebuffer;)V + public fun triggerStaticInitialization ()V +} + public class cc/polyfrost/oneconfig/platform/impl/PlatformImpl : cc/polyfrost/oneconfig/platform/Platform { public fun <init> ()V + public fun getLoader ()Lcc/polyfrost/oneconfig/platform/Platform$Loader; public fun getMinecraftVersion ()I public fun isCallingFromMinecraftThread ()Z } diff --git a/versions/1.12.2-forge/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java b/versions/1.12.2-forge/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java index 9492238..e318ba1 100644 --- a/versions/1.12.2-forge/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java +++ b/versions/1.12.2-forge/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java @@ -32,11 +32,6 @@ public class MinecraftMixin { Runtime.getRuntime().addShutdownHook(new Thread(() -> EventManager.INSTANCE.post(new ShutdownEvent()))); } - @Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/FMLClientHandler;beginMinecraftLoading(Lnet/minecraft/client/Minecraft;Ljava/util/List;Lnet/minecraft/client/resources/IReloadableResourceManager;Lnet/minecraft/client/resources/data/MetadataSerializer;)V", remap = false), remap = true) - private void onPreLaunch(CallbackInfo ci) { - OneConfig.preLaunch(); - } - @Inject(method = "init", 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.INSTANCE.post(new InitializationEvent()); diff --git a/versions/1.16.2-fabric/api/1.16.2-fabric.api b/versions/1.16.2-fabric/api/1.16.2-fabric.api new file mode 100644 index 0000000..51e5d73 --- /dev/null +++ b/versions/1.16.2-fabric/api/1.16.2-fabric.api @@ -0,0 +1,122 @@ +public class cc/polyfrost/oneconfig/events/event/ChatReceiveEvent : cc/polyfrost/oneconfig/events/event/CancellableEvent { + public final field message Lnet/minecraft/text/Text; + public fun <init> (Lnet/minecraft/text/Text;)V + public fun getFullyUnformattedMessage ()Ljava/lang/String; +} + +public class cc/polyfrost/oneconfig/events/event/ReceivePacketEvent : cc/polyfrost/oneconfig/events/event/CancellableEvent { + public final field packet Lnet/minecraft/network/Packet; + public fun <init> (Lnet/minecraft/network/Packet;)V +} + +public class cc/polyfrost/oneconfig/events/event/ScreenOpenEvent : cc/polyfrost/oneconfig/events/event/CancellableEvent { + public final field screen Lnet/minecraft/client/gui/screen/Screen; + public fun <init> (Lnet/minecraft/client/gui/screen/Screen;)V +} + +public class cc/polyfrost/oneconfig/events/event/SendPacketEvent : cc/polyfrost/oneconfig/events/event/CancellableEvent { + public final field packet Lnet/minecraft/network/Packet; + public fun <init> (Lnet/minecraft/network/Packet;)V +} + +public class cc/polyfrost/oneconfig/events/event/TimerUpdateEvent { + public final field timer Lnet/minecraft/client/render/RenderTickCounter; + public final field updatedDeltaTicks Z + public fun <init> (Lnet/minecraft/client/render/RenderTickCounter;Z)V +} + +public class cc/polyfrost/oneconfig/platform/impl/GLPlatformImpl : cc/polyfrost/oneconfig/platform/GLPlatform { + public fun <init> ()V + public fun drawRect (FFFFI)V + public fun drawText (Lcc/polyfrost/oneconfig/libs/universal/UMatrixStack;Ljava/lang/String;FFIZ)F + public fun enableStencil ()V + public fun getStringWidth (Ljava/lang/String;)I +} + +public class cc/polyfrost/oneconfig/platform/impl/GuiPlatformImpl : cc/polyfrost/oneconfig/platform/GuiPlatform { + public fun <init> ()V + public fun getCurrentScreen ()Ljava/lang/Object; + public fun isInChat ()Z + public fun isInDebug ()Z + public fun setCurrentScreen (Ljava/lang/Object;)V +} + +public class cc/polyfrost/oneconfig/platform/impl/I18nPlatformImpl : cc/polyfrost/oneconfig/platform/I18nPlatform { + public fun <init> ()V + public fun format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; +} + +public class cc/polyfrost/oneconfig/platform/impl/LoaderPlatformImpl : cc/polyfrost/oneconfig/platform/LoaderPlatform { + public fun <init> ()V + public fun getActiveModContainer ()Lcc/polyfrost/oneconfig/platform/LoaderPlatform$ActiveMod; + public fun hasActiveModContainer ()Z + public fun isModLoaded (Ljava/lang/String;)Z +} + +public class cc/polyfrost/oneconfig/platform/impl/MousePlatformImpl : cc/polyfrost/oneconfig/platform/MousePlatform { + public fun <init> ()V + public fun getButtonState (I)I + public fun getDWheel ()D + public fun getMouseDX ()D + public fun getMouseDY ()D + public fun getMouseX ()D + public fun getMouseY ()D + public fun isButtonDown (I)Z +} + +public class cc/polyfrost/oneconfig/platform/impl/NanoVGPlatformImpl : cc/polyfrost/oneconfig/platform/NanoVGPlatform { + public fun <init> ()V + public fun nnvgCreate (I)J + public fun nnvgDelete (J)V + public fun nnvglCreateImageFromHandle (JIIII)I + public fun nnvglImageHandle (JI)I + public fun nnvgluBindFramebuffer (JJ)V + public fun nnvgluCreateFramebuffer (JIII)J + public fun nnvgluDeleteFramebuffer (JJ)V + public fun nvgCreate (I)J + public fun nvgDelete (J)V + public fun nvglCreateImageFromHandle (JIIII)I + public fun nvglImageHandle (JI)I + public fun nvgluBindFramebuffer (JLorg/lwjgl/nanovg/NVGLUFramebuffer;)V + public fun nvgluCreateFramebuffer (JIII)Lorg/lwjgl/nanovg/NVGLUFramebuffer; + public fun nvgluDeleteFramebuffer (JLorg/lwjgl/nanovg/NVGLUFramebuffer;)V + public fun triggerStaticInitialization ()V +} + +public class cc/polyfrost/oneconfig/platform/impl/PlatformImpl : cc/polyfrost/oneconfig/platform/Platform { + public fun <init> ()V + public fun getLoader ()Lcc/polyfrost/oneconfig/platform/Platform$Loader; + public fun getMinecraftVersion ()I + public fun isCallingFromMinecraftThread ()Z +} + +public class cc/polyfrost/oneconfig/platform/impl/ServerPlatformImpl : cc/polyfrost/oneconfig/platform/ServerPlatform { + public fun <init> ()V + public fun getServerBrand ()Ljava/lang/String; + public fun inMultiplayer ()Z +} + +public class cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl : cc/polyfrost/oneconfig/utils/commands/PlatformCommandManager { + public fun <init> ()V + public fun handleNewParser (Lcc/polyfrost/oneconfig/utils/commands/arguments/ArgumentParser;Ljava/lang/Class;)V +} + +public final class cc/polyfrost/oneconfig/utils/dsl/DSLsKt { + public static final fun getMc ()Lnet/minecraft/client/MinecraftClient; +} + +public final class cc/polyfrost/oneconfig/utils/dsl/GuiUtilsDSLKt { + public static final fun openScreen (Lnet/minecraft/client/gui/screen/Screen;I)V + public static synthetic fun openScreen$default (Lnet/minecraft/client/gui/screen/Screen;IILjava/lang/Object;)V +} + +public final class cc/polyfrost/oneconfig/utils/gui/GuiUtils { + public fun <init> ()V + public static fun closeScreen ()V + public static fun displayScreen (Ljava/lang/Object;)V + public static fun displayScreen (Lnet/minecraft/client/gui/screen/Screen;)V + public static fun displayScreen (Lnet/minecraft/client/gui/screen/Screen;I)V + public static fun getDeltaTime ()F + public static fun getScreenQueue ()Ljava/util/Deque; +} + diff --git a/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/hook/FramebufferHook.java b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/hook/FramebufferHook.java new file mode 100644 index 0000000..d0125ea --- /dev/null +++ b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/hook/FramebufferHook.java @@ -0,0 +1,6 @@ +package cc.polyfrost.oneconfig.internal.hook; + +public interface FramebufferHook { + boolean isStencilEnabled(); + void enableStencil(); +} diff --git a/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/FramebufferMixin.java b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/FramebufferMixin.java new file mode 100644 index 0000000..5f182c5 --- /dev/null +++ b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/FramebufferMixin.java @@ -0,0 +1,62 @@ +package cc.polyfrost.oneconfig.internal.mixin; + +import cc.polyfrost.oneconfig.internal.hook.FramebufferHook; +import com.mojang.blaze3d.platform.FramebufferInfo; +import com.mojang.blaze3d.platform.GlStateManager; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gl.Framebuffer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import java.nio.IntBuffer; + +/** + * Modified from MinecraftForge + * <a href="https://github.com/MinecraftForge/MinecraftForge/blob/1.19.x/LICENSE.txt">...</a> + */ +@Mixin(Framebuffer.class) +public abstract class FramebufferMixin implements FramebufferHook { + @Shadow public int textureWidth; + @Shadow public int textureHeight; + @Shadow private int depthAttachment; + + @Shadow public abstract void resize(int width, int height, boolean getError); + + @Shadow public int viewportWidth; + @Shadow public int viewportHeight; + private boolean stencilEnabled = false; + + @Redirect(method = "initFbo", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;texImage2D(IIIIIIIILjava/nio/IntBuffer;)V", ordinal = 0)) + private void stencilSupport(int target, int level, int internalFormat, int width, int height, int border, int format, int type, IntBuffer pixels) { + if (stencilEnabled) { + GlStateManager.texImage2D(3553, 0, 36013, textureWidth, textureHeight, 0, 34041, 36269, null); + } else { + GlStateManager.texImage2D(3553, 0, 6402, textureWidth, textureHeight, 0, 6402, 5126, null); + } + } + + @Redirect(method = "initFbo", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;framebufferTexture2D(IIIII)V", ordinal = 1)) + private void stencilSupport(int target, int attachment, int textureTarget, int texture, int level) { + if (stencilEnabled) { + GlStateManager.framebufferTexture2D(FramebufferInfo.FRAME_BUFFER, 36096, 3553, depthAttachment, 0); + GlStateManager.framebufferTexture2D(FramebufferInfo.FRAME_BUFFER, 36128, 3553, depthAttachment, 0); + } else { + GlStateManager.framebufferTexture2D(FramebufferInfo.FRAME_BUFFER, FramebufferInfo.DEPTH_ATTACHMENT, 3553, depthAttachment, 0); + } + } + + @Override + public boolean isStencilEnabled() { + return stencilEnabled; + } + + @Override + public void enableStencil() { + if (!this.stencilEnabled) { + this.stencilEnabled = true; + resize(viewportWidth, viewportHeight, MinecraftClient.IS_SYSTEM_MAC); + } + } +} diff --git a/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GameRendererAccessor.java b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GameRendererAccessor.java new file mode 100644 index 0000000..0ebe121 --- /dev/null +++ b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GameRendererAccessor.java @@ -0,0 +1,12 @@ +package cc.polyfrost.oneconfig.internal.mixin; + +import net.minecraft.client.render.GameRenderer; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(GameRenderer.class) +public interface GameRendererAccessor { + @Invoker + void invokeLoadShader(Identifier identifier); +} diff --git a/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java new file mode 100644 index 0000000..6a8d283 --- /dev/null +++ b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java @@ -0,0 +1,19 @@ +package cc.polyfrost.oneconfig.internal.mixin; + +import cc.polyfrost.oneconfig.events.EventManager; +import cc.polyfrost.oneconfig.events.event.HudRenderEvent; +import cc.polyfrost.oneconfig.libs.universal.UMatrixStack; +import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.client.util.math.MatrixStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(InGameHud.class) +public class GuiIngameForgeMixin { + @Inject(method = "render", at = @At("TAIL")) + private void onRenderGameOverlay(MatrixStack matrices, float tickDelta, CallbackInfo ci) { + EventManager.INSTANCE.post(new HudRenderEvent(new UMatrixStack(matrices), tickDelta)); + } +}
\ No newline at end of file diff --git a/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/KeyboardMixin.java b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/KeyboardMixin.java new file mode 100644 index 0000000..7d0a33f --- /dev/null +++ b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/KeyboardMixin.java @@ -0,0 +1,20 @@ +package cc.polyfrost.oneconfig.internal.mixin; + +import cc.polyfrost.oneconfig.events.EventManager; +import cc.polyfrost.oneconfig.events.event.KeyInputEvent; +import net.minecraft.client.Keyboard; +import net.minecraft.client.MinecraftClient; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(Keyboard.class) +public class KeyboardMixin { + @Inject(method = "onKey", at = @At("TAIL")) + private void onKeyEvent(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) { + if (windowPointer == MinecraftClient.getInstance().getWindow().getHandle()) { + EventManager.INSTANCE.post(new KeyInputEvent()); + } + } +} diff --git a/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java new file mode 100644 index 0000000..0acb015 --- /dev/null +++ b/versions/1.16.2-fabric/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java @@ -0,0 +1,60 @@ +package cc.polyfrost.oneconfig.internal.mixin; + +import cc.polyfrost.oneconfig.events.EventManager; +import cc.polyfrost.oneconfig.events.event.*; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.render.RenderTickCounter; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecraftClient.class) +public class MinecraftMixin { + @Final + @Shadow + private RenderTickCounter renderTickCounter; + + @Inject(method = "stop", at = @At("HEAD")) + private void onShutdown(CallbackInfo ci) { + EventManager.INSTANCE.post(new PreShutdownEvent()); + } + + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V", ordinal = 0)) + private void onRenderTickStart(CallbackInfo ci) { + EventManager.INSTANCE.post(new RenderEvent(Stage.START, renderTickCounter.tickDelta)); + } + + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;pop()V", shift = At.Shift.AFTER, ordinal = 4)) + private void onRenderTickEnd(CallbackInfo ci) { + EventManager.INSTANCE.post(new RenderEvent(Stage.END, renderTickCounter.tickDelta)); + } + + @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", ordinal = 0)) + private void onClientTickStart(CallbackInfo ci) { + EventManager.INSTANCE.post(new TickEvent(Stage.START)); + } + + @Inject(method = "tick", at = @At("TAIL")) + private void onClientTickEnd(CallbackInfo ci) { + EventManager.INSTANCE.post(new TickEvent(Stage.END)); + } + + @Inject(method = "openScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;requestRespawn()V", shift = At.Shift.BY, by = 2), cancellable = true) + private void onGuiOpenEvent(Screen screen, CallbackInfo ci) { + ScreenOpenEvent event = new ScreenOpenEvent(screen); + EventManager.INSTANCE.post(event); + if (event.isCancelled) { + ci.cancel(); + } + } + + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderTickCounter;beginRenderTick(J)I", shift = At.Shift.AFTER)) + private void onDeltaTickTimerUpdate(CallbackInfo ci) { + EventManager.INSTANCE.post(new TimerUpdateEvent(renderTickCounter, |
