aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/mixins/MixinClientPlayNetworkHandler.kt
blob: b94ff65ae94d497f1cbd8f64f45284393b5c5459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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())
    }
}