diff options
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/CustomPayloadEventDispatcher.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/CustomPayloadEventDispatcher.java | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/CustomPayloadEventDispatcher.java b/src/main/java/moe/nea/firmament/mixins/CustomPayloadEventDispatcher.java deleted file mode 100644 index 66710eb..0000000 --- a/src/main/java/moe/nea/firmament/mixins/CustomPayloadEventDispatcher.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe> - * - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -package moe.nea.firmament.mixins; - -import moe.nea.firmament.apis.ingame.FirmamentCustomPayload; -import moe.nea.firmament.events.FirmamentCustomPayloadEvent; -import net.minecraft.client.network.ClientPlayNetworkHandler; -import net.minecraft.network.packet.CustomPayload; -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(ClientPlayNetworkHandler.class) -public class CustomPayloadEventDispatcher { - @Inject(method = "onCustomPayload", at = @At("HEAD"), cancellable = true) - private void handleFirmamentParsedPayload(CustomPayload payload, CallbackInfo ci) { - if (payload instanceof FirmamentCustomPayload customPayload) { - FirmamentCustomPayloadEvent.Companion.publish(new FirmamentCustomPayloadEvent(customPayload)); - ci.cancel(); - } - } -} |