aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/mixin
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-04 14:22:03 +0700
committerGitHub <noreply@github.com>2022-06-04 09:22:03 +0200
commitd77df8fd5fa42b35c3e655f8e95874338b611901 (patch)
tree28cc6c1c98535827b815fe4cf175c52312877427 /src/main/java/cc/polyfrost/oneconfig/mixin
parent07741d92fa6ea636b8292bb35706c25e5e6a72cc (diff)
downloadOneConfig-d77df8fd5fa42b35c3e655f8e95874338b611901.tar.gz
OneConfig-d77df8fd5fa42b35c3e655f8e95874338b611901.tar.bz2
OneConfig-d77df8fd5fa42b35c3e655f8e95874338b611901.zip
move from mod events to mixin (#31)
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/mixin')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java b/src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java
index 1226244..5d11729 100644
--- a/src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java
+++ b/src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java
@@ -1,5 +1,6 @@
package cc.polyfrost.oneconfig.mixin;
+import cc.polyfrost.oneconfig.OneConfig;
import cc.polyfrost.oneconfig.events.EventManager;
import cc.polyfrost.oneconfig.events.event.*;
import cc.polyfrost.oneconfig.libs.mixinextras.injector.ModifyExpressionValue;
@@ -17,6 +18,16 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class MinecraftMixin {
@Shadow private Timer timer;
+ @Inject(method = "startGame", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/FMLClientHandler;beginMinecraftLoading(Lnet/minecraft/client/Minecraft;Ljava/util/List;Lnet/minecraft/client/resources/IReloadableResourceManager;)V", remap = false), remap = true)
+ private void onPreLaunch(CallbackInfo ci) {
+ OneConfig.preLaunch();
+ }
+
+ @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) {
+ 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));