use of anticope.rejects.events.CustomPayloadEvent in project meteor-rejects by AntiCope.
the class CustomPayloadS2CPacketMixin method onApply.
@Inject(method = "apply(Lnet/minecraft/network/listener/ClientPlayPacketListener;)V", at = @At(value = "HEAD"), cancellable = true)
private void onApply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo info) {
CustomPayloadS2CPacket packet = (CustomPayloadS2CPacket) (Object) this;
CustomPayloadEvent event = MeteorClient.EVENT_BUS.post(CustomPayloadEvent.get(packet));
if (event.isCancelled()) {
info.cancel();
}
}
Aggregations