From 42897030f711b97df293b79f978defc37c2c90c1 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 28 Apr 2024 11:39:43 +0200 Subject: [PATCH] Fix entity effect reading below 1.20.2 Fixes #3811 --- .../protocol1_18_2to1_19/packets/EntityPackets1_19.java | 4 +--- .../rewriter/EntityPacketRewriter1_20_2.java | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java index 7f1f1372..d5b4ff46 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java @@ -109,9 +109,7 @@ public final class EntityPackets1_19 extends EntityRewriter { // Remove factor data - if (wrapper.read(Type.BOOLEAN)) { - wrapper.read(Type.NAMED_COMPOUND_TAG); - } + wrapper.read(Type.OPTIONAL_NAMED_COMPOUND_TAG); }); } }); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20to1_20_2/rewriter/EntityPacketRewriter1_20_2.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20to1_20_2/rewriter/EntityPacketRewriter1_20_2.java index 1e596efe..d14dfd65 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20to1_20_2/rewriter/EntityPacketRewriter1_20_2.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20to1_20_2/rewriter/EntityPacketRewriter1_20_2.java @@ -28,6 +28,7 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.types.version.Types1_20; import com.viaversion.viaversion.api.type.types.version.Types1_20_2; +import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ClientboundPackets1_19_4; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2; @@ -184,9 +185,9 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter {