aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/mixin
diff options
context:
space:
mode:
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));