From a046b198645811fe1b7db129942505c379aabb03 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 17 Dec 2024 23:07:06 +0100 Subject: feat: Add name prefetching --- .../ledger/mixin/OnInitializationCompletePatch.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/moe/nea/ledger/mixin/OnInitializationCompletePatch.java (limited to 'src/main/java/moe/nea/ledger') diff --git a/src/main/java/moe/nea/ledger/mixin/OnInitializationCompletePatch.java b/src/main/java/moe/nea/ledger/mixin/OnInitializationCompletePatch.java new file mode 100644 index 0000000..fc9afb7 --- /dev/null +++ b/src/main/java/moe/nea/ledger/mixin/OnInitializationCompletePatch.java @@ -0,0 +1,18 @@ +package moe.nea.ledger.mixin; + +import moe.nea.ledger.events.InitializationComplete; +import net.minecraft.client.Minecraft; +import net.minecraftforge.common.MinecraftForge; +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(Minecraft.class) +public class OnInitializationCompletePatch { + + @Inject(method = "startGame", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/FMLClientHandler;onInitializationComplete()V")) + private void onInitComplete(CallbackInfo ci) { + MinecraftForge.EVENT_BUS.post(new InitializationComplete()); + } +} -- cgit