diff options
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/custompayload/CustomPayloadEventDispatcher.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/custompayload/CustomPayloadEventDispatcher.java | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/custompayload/CustomPayloadEventDispatcher.java b/src/main/java/moe/nea/firmament/mixins/custompayload/CustomPayloadEventDispatcher.java deleted file mode 100644 index 2084821..0000000 --- a/src/main/java/moe/nea/firmament/mixins/custompayload/CustomPayloadEventDispatcher.java +++ /dev/null @@ -1,22 +0,0 @@ - -package moe.nea.firmament.mixins.custompayload; - -import moe.nea.firmament.apis.ingame.FirmamentCustomPayload; -import moe.nea.firmament.events.FirmamentCustomPayloadEvent; -import net.minecraft.client.network.ClientCommonNetworkHandler; -import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; -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; - -@Mixin(value = ClientCommonNetworkHandler.class, priority = 500) -public class CustomPayloadEventDispatcher { - @Inject(method = "onCustomPayload(Lnet/minecraft/network/packet/s2c/common/CustomPayloadS2CPacket;)V", at = @At("HEAD"), cancellable = true) - private void handleFirmamentParsedPayload(CustomPayloadS2CPacket packet, CallbackInfo ci) { - if (packet.payload() instanceof FirmamentCustomPayload customPayload) { - FirmamentCustomPayloadEvent.Companion.publishSync(new FirmamentCustomPayloadEvent(customPayload)); - ci.cancel(); - } - } -} |