From f4cc9d4730fd074d2c82bc2b6f02d4052fb57c8e Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 10 Aug 2023 17:06:49 +1000 Subject: [PATCH] Fix double register --- .../rewriter/EntityPacketRewriter1_20_2.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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 cc9a53b1..3441f958 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 @@ -43,15 +43,6 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { - wrapper.passthrough(Type.VAR_INT); // Entity id - wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id - }); - protocol.registerClientbound(ClientboundPackets1_20_2.ENTITY_EFFECT, wrapper -> { - wrapper.passthrough(Type.VAR_INT); // Entity id - wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id - }); - protocol.registerClientbound(ClientboundPackets1_20_2.JOIN_GAME, new PacketHandlers() { @Override public void register() { @@ -123,7 +114,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { wrapper.passthrough(Type.VAR_INT); // Entity id - wrapper.passthrough(Type.VAR_INT); // Effect id + wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id wrapper.passthrough(Type.BYTE); // Amplifier wrapper.passthrough(Type.VAR_INT); // Duration wrapper.passthrough(Type.BYTE); // Flags @@ -131,6 +122,11 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { + wrapper.passthrough(Type.VAR_INT); // Entity id + wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id + }); } @Override