From a4531638225cd1542c0b67d8e1ae6597e0a2995c Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 7 Mar 2024 11:14:34 +0100 Subject: [PATCH] Some 24w10a changes --- .../BackwardsStructuredItemRewriter.java | 4 ++-- .../Protocol1_20_3To1_20_5.java | 11 +++++++---- .../BlockItemPacketRewriter1_20_5.java | 2 +- .../rewriter/EntityPacketRewriter1_20_5.java | 13 ++++++++----- .../data/mappings-1.20.5to1.20.3.nbt | Bin 114091 -> 114168 bytes gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- settings.gradle.kts | 1 + 8 files changed, 21 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/BackwardsStructuredItemRewriter.java b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/BackwardsStructuredItemRewriter.java index c388e88a..af69372b 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/BackwardsStructuredItemRewriter.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/BackwardsStructuredItemRewriter.java @@ -72,7 +72,7 @@ public class BackwardsStructuredItemRewriter(this).registerDeclareCommands1_19(ClientboundPackets1_20_5.DECLARE_COMMANDS); + cancelClientbound(ClientboundPackets1_20_5.DEBUG_SAMPLE); } @@ -205,10 +208,10 @@ public final class Protocol1_20_3To1_20_5 extends BackwardsProtocol createPacketTypesProvider() { return new SimplePacketTypesProvider<>( - packetTypeMap(unmappedClientboundPacketType, ClientboundPackets1_20_5.class, ClientboundConfigurationPackets1_20_5.class), - packetTypeMap(mappedClientboundPacketType, ClientboundPackets1_20_3.class, ClientboundConfigurationPackets1_20_3.class), - packetTypeMap(mappedServerboundPacketType, ServerboundPackets1_20_5.class, ServerboundConfigurationPackets1_20_5.class), - packetTypeMap(unmappedServerboundPacketType, ServerboundPackets1_20_3.class, ServerboundConfigurationPackets1_20_2.class) + packetTypeMap(unmappedClientboundPacketType, ClientboundPackets1_20_5.class, ClientboundConfigurationPackets1_20_5.class), + packetTypeMap(mappedClientboundPacketType, ClientboundPackets1_20_3.class, ClientboundConfigurationPackets1_20_3.class), + packetTypeMap(mappedServerboundPacketType, ServerboundPackets1_20_5.class, ServerboundConfigurationPackets1_20_5.class), + packetTypeMap(unmappedServerboundPacketType, ServerboundPackets1_20_3.class, ServerboundConfigurationPackets1_20_2.class) ); } } \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java index 8dbc653b..c26ec1da 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java @@ -166,7 +166,7 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem if (item == null) return null; // Convert to structured item first - final Item structuredItem = vvProtocol.getItemRewriter().toStructuredItem(item); + final Item structuredItem = vvProtocol.getItemRewriter().toStructuredItem(item, false); return super.handleItemToServer(structuredItem); } } \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java index 5a05bdde..0ef40375 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/EntityPacketRewriter1_20_5.java @@ -226,13 +226,15 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { - int id = meta.metaType().typeId(); - if (id >= Types1_20_5.META_TYPES.armadilloState.typeId()) { + filter().mapMetaType(typeId -> { + int id = typeId; + if (typeId >= Types1_20_5.META_TYPES.armadilloState.typeId()) { id--; } - - meta.setMetaType(Types1_20_3.META_TYPES.byId(id)); + if (typeId >= Types1_20_5.META_TYPES.wolfVariantType.typeId()) { + id--; + } + return Types1_20_3.META_TYPES.byId(id); }); registerMetaTypeHandler1_20_3( @@ -251,6 +253,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriterj1FlDAN jGBdCgLj;Vu8JH4FfHI6gtOVqg