diff options
author | Linnea Gräf <nea@nea.moe> | 2024-06-05 01:04:55 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-06-05 01:04:55 +0200 |
commit | db2b96bd9801d1e9f0dc108520310f9add8df4b7 (patch) | |
tree | 559fa8ce7db8b3cc6b488c1bf8c0411a1b809bb8 /src/main/java/moe/nea/firmament/mixins/CustomPayloadEventDispatcher.java | |
parent | 3b9fd665af85f08f3bcae711f99c49528fc4b666 (diff) | |
download | firmament-db2b96bd9801d1e9f0dc108520310f9add8df4b7.tar.gz firmament-db2b96bd9801d1e9f0dc108520310f9add8df4b7.tar.bz2 firmament-db2b96bd9801d1e9f0dc108520310f9add8df4b7.zip |
Fix custom payload event
[no changelog]
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(); - } - } -} |