From d6279757bb8553f5e32a3c29f5d4051a5f1bdf2a Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 24 Aug 2024 17:20:42 +0200 Subject: [PATCH] Also explicitly map entity data list type in 1.12 --- .../api/rewriters/LegacyEntityRewriter.java | 24 ------------------- .../rewriter/EntityPacketRewriter1_12.java | 11 +++++---- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/LegacyEntityRewriter.java b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/LegacyEntityRewriter.java index 4dc41852..8728902e 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/LegacyEntityRewriter.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/LegacyEntityRewriter.java @@ -92,30 +92,6 @@ public abstract class LegacyEntityRewriter> dataType, Type> mappedDataType) { - protocol.registerClientbound(packetType, new PacketHandlers() { - @Override - public void register() { - map(Types.VAR_INT); // 0 - Entity ID - if (dataType != null) { - map(dataType, mappedDataType); - } else { - map(mappedDataType); - } - handler(wrapper -> { - List entityDataList = wrapper.get(mappedDataType, 0); - handleEntityData(wrapper.get(Types.VAR_INT, 0), entityDataList, wrapper.user()); - }); - } - }); - } - - @Override - public void registerSetEntityData(C packetType, Type> dataType) { - registerSetEntityData(packetType, null, dataType); - } - protected PacketHandler getMobSpawnRewriter(Type> dataType, IdSetter idSetter) { return wrapper -> { int entityId = wrapper.get(Types.VAR_INT, 0); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_12to1_11_1/rewriter/EntityPacketRewriter1_12.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_12to1_11_1/rewriter/EntityPacketRewriter1_12.java index 2c9020d0..b6a73f53 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_12to1_11_1/rewriter/EntityPacketRewriter1_12.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_12to1_11_1/rewriter/EntityPacketRewriter1_12.java @@ -31,6 +31,7 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.types.version.Types1_12; +import com.viaversion.viaversion.api.type.types.version.Types1_9; import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.protocols.v1_11_1to1_12.packet.ClientboundPackets1_12; import com.viaversion.viaversion.protocols.v1_9_1to1_9_3.packet.ClientboundPackets1_9_3; @@ -83,13 +84,13 @@ public class EntityPacketRewriter1_12 extends LegacyEntityRewriter