From f93df266c60de0567be1c963d0fbc0861bc4f197 Mon Sep 17 00:00:00 2001 From: nea Date: Wed, 3 May 2023 01:09:19 +0200 Subject: Move WorldReadyEvent back more --- .../mixins/MixinDownloadingTerrainScreen.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/java/moe/nea/notenoughupdates/mixins/MixinDownloadingTerrainScreen.java (limited to 'src/main/java/moe/nea/notenoughupdates/mixins/MixinDownloadingTerrainScreen.java') diff --git a/src/main/java/moe/nea/notenoughupdates/mixins/MixinDownloadingTerrainScreen.java b/src/main/java/moe/nea/notenoughupdates/mixins/MixinDownloadingTerrainScreen.java new file mode 100644 index 0000000..3ed8a73 --- /dev/null +++ b/src/main/java/moe/nea/notenoughupdates/mixins/MixinDownloadingTerrainScreen.java @@ -0,0 +1,16 @@ +package moe.nea.notenoughupdates.mixins; + +import moe.nea.notenoughupdates.events.WorldReadyEvent; +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) +public class MixinDownloadingTerrainScreen { + @Inject(method = "close", at = @At("HEAD")) + public void onClose(CallbackInfo ci) { + WorldReadyEvent.Companion.publish(new WorldReadyEvent()); + } +} -- cgit