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/MixinClientPlayNetworkHandler.java | 17 ----------------- .../mixins/MixinDownloadingTerrainScreen.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 src/main/java/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.java create mode 100644 src/main/java/moe/nea/notenoughupdates/mixins/MixinDownloadingTerrainScreen.java (limited to 'src/main/java') diff --git a/src/main/java/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.java b/src/main/java/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.java deleted file mode 100644 index 34334b6..0000000 --- a/src/main/java/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.java +++ /dev/null @@ -1,17 +0,0 @@ -package moe.nea.notenoughupdates.mixins; - -import moe.nea.notenoughupdates.events.WorldReadyEvent; -import net.minecraft.client.network.ClientPlayNetworkHandler; -import net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket; -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(ClientPlayNetworkHandler.class) -public class MixinClientPlayNetworkHandler { - @Inject(method = "onPlayerSpawnPosition", at = @At("RETURN")) - public void onOnPlayerSpawnPosition(PlayerSpawnPositionS2CPacket packet, CallbackInfo ci) { - WorldReadyEvent.Companion.publish(new WorldReadyEvent()); - } -} 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