aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/mixins/hooks/NetworkManagerHook.kt
blob: b9265587a7042aa873adf5207d8515c8a68f2cfb (plain)
1
2
3
4
5
6
7
8
9
10
package at.hannibal2.skyhanni.mixins.hooks

import at.hannibal2.skyhanni.events.PacketEvent
import io.netty.channel.ChannelHandlerContext
import net.minecraft.network.Packet
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo

fun onReceivePacket(context: ChannelHandlerContext, packet: Packet<*>, ci: CallbackInfo) {
    if (PacketEvent.ReceiveEvent(packet).postAndCatch()) ci.cancel()
}