use of me.wallhacks.spark.event.player.PacketReceiveEvent in project Spark-Client by Spark-Client-Development.
the class MixinNetworkManager method channelRead0.
@Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true)
public void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_, final CallbackInfo callbackInfo) {
PacketReceiveEvent event = new PacketReceiveEvent(p_channelRead0_2_);
Spark.eventBus.post(event);
if (event.isCanceled()) {
callbackInfo.cancel();
}
}
Aggregations