diff options
Diffstat (limited to 'src/main/java/moe/nea/firmament')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java b/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java index c444f12..d4b8c9e 100644 --- a/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/WorldReadyEventPatch.java @@ -3,16 +3,17 @@ package moe.nea.firmament.mixins; import moe.nea.firmament.events.WorldReadyEvent; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.DownloadingTerrainScreen; 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(DownloadingTerrainScreen.class) +@Mixin(MinecraftClient.class) public class WorldReadyEventPatch { - @Inject(method = "close", at = @At("HEAD")) - public void onClose(CallbackInfo ci) { - WorldReadyEvent.Companion.publish(new WorldReadyEvent()); - } + @Inject(method = "joinWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;setWorld(Lnet/minecraft/client/world/ClientWorld;)V", shift = At.Shift.AFTER)) + public void onClose(CallbackInfo ci) { + WorldReadyEvent.Companion.publish(new WorldReadyEvent()); + } } |