aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/mixins
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-10-09 04:58:37 +0200
committernea <romangraef@gmail.com>2022-10-09 04:58:37 +0200
commitebffedd08c3ce32b7cd4ef6314f3f0efce7fbf51 (patch)
treea56760fa212cd20fc7719b56d10a92ac33ffc27e /src/main/kotlin/moe/nea/notenoughupdates/mixins
parent4d73331a449f0b0647066f7dde0628730fe0e178 (diff)
downloadFirmament-ebffedd08c3ce32b7cd4ef6314f3f0efce7fbf51.tar.gz
Firmament-ebffedd08c3ce32b7cd4ef6314f3f0efce7fbf51.tar.bz2
Firmament-ebffedd08c3ce32b7cd4ef6314f3f0efce7fbf51.zip
stuff
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/mixins')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.kt17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.kt b/src/main/kotlin/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.kt
new file mode 100644
index 0000000..b94ff65
--- /dev/null
+++ b/src/main/kotlin/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.kt
@@ -0,0 +1,17 @@
+package moe.nea.notenoughupdates.mixins
+
+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
+import net.minecraft.client.network.ClientPlayNetworkHandler
+import net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket
+import moe.nea.notenoughupdates.events.WorldReadyEvent
+
+@Mixin(ClientPlayNetworkHandler::class)
+class MixinClientPlayNetworkHandler {
+ @Inject(method = ["onPlayerSpawnPosition"], at = [At("RETURN")])
+ fun onOnPlayerSpawnPosition(packet: PlayerSpawnPositionS2CPacket, ci: CallbackInfo) {
+ WorldReadyEvent.publish(WorldReadyEvent())
+ }
+}