aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-08 17:52:10 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-08 17:52:10 +0100
commitf6f8fef556e74f24187ad2a6296f573024a378b3 (patch)
treee6d8873e15e88c23d42b8634dad7179fbd198eec /src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java
parent06534f9d09732ed29a6fa6bc48def5f7c2b0b865 (diff)
downloadFirmament-f6f8fef556e74f24187ad2a6296f573024a378b3.tar.gz
Firmament-f6f8fef556e74f24187ad2a6296f573024a378b3.tar.bz2
Firmament-f6f8fef556e74f24187ad2a6296f573024a378b3.zip
Fix line renderer
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java b/src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java
new file mode 100644
index 0000000..0a90b35
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/MainWindowFirstLoadPatch.java
@@ -0,0 +1,31 @@
+package moe.nea.firmament.mixins;
+
+import moe.nea.firmament.Firmament;
+import moe.nea.firmament.events.DebugInstantiateEvent;
+import net.minecraft.client.gui.LogoDrawer;
+import net.minecraft.client.gui.screen.TitleScreen;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Unique;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+
+@Mixin(TitleScreen.class)
+public class MainWindowFirstLoadPatch {
+ @Unique
+ private static boolean hasInited = false;
+
+ @Inject(method = "<init>(ZLnet/minecraft/client/gui/LogoDrawer;)V", at = @At("RETURN"))
+ private void onCreate(boolean doBackgroundFade, LogoDrawer logoDrawer, CallbackInfo ci) {
+ if (!hasInited) {
+ try {
+ DebugInstantiateEvent.Companion.publish(new DebugInstantiateEvent());
+ } catch (Throwable t) {
+ Firmament.INSTANCE.getLogger().error("Failed to instantiate debug instances", t);
+ System.exit(1);
+ throw t;
+ }
+ }
+ hasInited = true;
+ }
+}