From 218b2abe45f852894b03bc17d9f69f7ca91f4375 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 10 May 2024 16:52:44 +0200 Subject: [PATCH] 24w19a --- .../Protocol1_20_5To1_21.java | 3 +++ .../rewriter/BlockItemPacketRewriter1_21.java | 16 ++++++++++------ .../viabackwards/data/mappings-1.21to1.20.5.nbt | Bin 794 -> 818 bytes gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_5to1_21/Protocol1_20_5To1_21.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_5to1_21/Protocol1_20_5To1_21.java index bd95427c..eaede343 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_5to1_21/Protocol1_20_5To1_21.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_5to1_21/Protocol1_20_5To1_21.java @@ -81,6 +81,9 @@ public final class Protocol1_20_5To1_21 extends BackwardsProtocol(protocol).register1_20_5(ClientboundPackets1_20_5.DECLARE_RECIPES); } @@ -85,11 +86,12 @@ public final class BlockItemPacketRewriter1_21 extends BackwardsStructuredItemRe public @Nullable Item handleItemToClient(final UserConnection connection, @Nullable final Item item) { if (item == null) return null; - item.structuredData().setIdLookup(protocol, true); + final StructuredDataContainer data = item.structuredData(); + data.setIdLookup(protocol, true); + data.replaceKey(StructuredDataKey.FOOD1_21, StructuredDataKey.FOOD1_20_5); // Enchantments final EnchantmentsPaintingsStorage storage = connection.get(EnchantmentsPaintingsStorage.class); - final StructuredDataContainer data = item.structuredData(); final IdRewriteFunction idRewriteFunction = id -> { final String key = storage.enchantments().idToKey(id); return key != null ? Enchantments1_20_5.keyToId(key) : -1; @@ -118,6 +120,8 @@ public final class BlockItemPacketRewriter1_21 extends BackwardsStructuredItemRe final StructuredDataContainer dataContainer = item.structuredData(); dataContainer.setIdLookup(protocol, false); + dataContainer.replaceKey(StructuredDataKey.FOOD1_20_5, StructuredDataKey.FOOD1_21); + // Rewrite enchantments final EnchantmentsPaintingsStorage storage = connection.get(EnchantmentsPaintingsStorage.class); rewriteEnchantmentToServer(storage, item, StructuredDataKey.ENCHANTMENTS); diff --git a/common/src/main/resources/assets/viabackwards/data/mappings-1.21to1.20.5.nbt b/common/src/main/resources/assets/viabackwards/data/mappings-1.21to1.20.5.nbt index d108819b0907f238a84a48f01c40edd16fbee4ca..16580da3c9eb6890191ca6dbc875143c7a527f44 100644 GIT binary patch delta 61 zcmbQmwux;*i4i*k1G793D*$mI0|U!cAf5)qi-34BHv>~iJ_7>-NKpV(Vc^ET9wq=H CJPAAi delta 17 YcmdnQHj8aS2_wtIMhQlijmvtN05U@bb^rhX diff --git a/gradle.properties b/gradle.properties index 90786604..ca68b79c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.0.0-24w18a-SNAPSHOT +projectVersion=5.0.0-24w19a-SNAPSHOT # Smile emoji mcVersions=1.20.6,1.20.5,1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9eb83965..e6779a8d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ metadata.format.version = "1.1" [versions] # ViaVersion -viaver = "5.0.0-24w18a-SNAPSHOT" +viaver = "5.0.0-24w19a-SNAPSHOT" # Common provided netty = "4.0.20.Final"