From 2e0acf169b2f9f7d19ebad9d6a498af556224980 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 11 Oct 2023 16:43:32 +1000 Subject: [PATCH] Actually track 1.20.2 entities Fixes #609, #597 --- .../rewriter/EntityPacketRewriter1_20_2.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 1816b8a3..204ffbd0 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 @@ -47,9 +47,12 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter { final int entityId = wrapper.passthrough(Type.VAR_INT); + wrapper.passthrough(Type.UUID); // UUID final int entityType = wrapper.read(Type.VAR_INT); + tracker(wrapper.user()).addEntity(entityId, typeFromId(entityType)); + if (entityType != Entity1_19_4Types.PLAYER.getId()) { wrapper.write(Type.VAR_INT, entityType); @@ -193,7 +196,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter meta.setMetaType(Types1_20.META_TYPES.byId(meta.metaType().typeId()))); - registerMetaTypeHandler(null, Types1_20.META_TYPES.blockStateType, Types1_20.META_TYPES.optionalBlockStateType, Types1_20.META_TYPES.particleType, null, null); + registerMetaTypeHandler(Types1_20.META_TYPES.itemType, Types1_20.META_TYPES.blockStateType, Types1_20.META_TYPES.optionalBlockStateType, Types1_20.META_TYPES.particleType, null, null); filter().filterFamily(Entity1_19_4Types.DISPLAY).removeIndex(10);