diff options
author | nea <nea@nea.moe> | 2023-09-25 19:24:16 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-09-25 19:24:46 +0200 |
commit | 139089d9beb134465737c4afff3b1303bf481aa1 (patch) | |
tree | ca2582bee8d9988afe9ca4f6ed70b043d47aaf3a /src/main/java/moe/nea/firmament/mixins/devenv | |
parent | 2bd3ed1e238d75c4a185656ac6fd857ac6897a99 (diff) | |
download | firmament-139089d9beb134465737c4afff3b1303bf481aa1.tar.gz firmament-139089d9beb134465737c4afff3b1303bf481aa1.tar.bz2 firmament-139089d9beb134465737c4afff3b1303bf481aa1.zip |
Port to 1.20.2
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/devenv')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/devenv/DisableCommonPacketWarnings.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/devenv/DisableCommonPacketWarnings.java b/src/main/java/moe/nea/firmament/mixins/devenv/DisableCommonPacketWarnings.java index 9fc2ab0..3d557fc 100644 --- a/src/main/java/moe/nea/firmament/mixins/devenv/DisableCommonPacketWarnings.java +++ b/src/main/java/moe/nea/firmament/mixins/devenv/DisableCommonPacketWarnings.java @@ -7,21 +7,24 @@ package moe.nea.firmament.mixins.devenv; import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.network.packet.CustomPayload; import net.minecraft.util.Identifier; import org.slf4j.Logger; 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.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Objects; @Mixin(ClientPlayNetworkHandler.class) public class DisableCommonPacketWarnings { - @Redirect(method = "onCustomPayload", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V", remap = false)) - public void onCustomPacket(Logger instance, String s, Object o) { - if (!Objects.equals(o, Identifier.of("badlion", "mods"))) { - instance.warn(s, o); + @Inject(method = "method_52801", at = @At("HEAD")) + public void onCustomPacketError(CustomPayload customPayload, CallbackInfo ci) { + if (Objects.equals(customPayload.id(), Identifier.of("badlion", "mods"))) { + ci.cancel(); } } |