From 974b15243a8375bffaa43154b37ab476d99ca0cf Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Wed, 15 Mar 2023 04:01:25 +0900 Subject: [PATCH] Fix enchantments in 1.12 -> 1.13 (#533) --- .../protocol1_12_2to1_13/packets/BlockItemPackets1_13.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java index 09113fd4..d95eb4e6 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java @@ -56,6 +56,7 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.data.SpawnEggRew import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.types.Chunk1_13Type; import com.viaversion.viaversion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; +import com.viaversion.viaversion.util.Key; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -634,7 +635,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit lore.add(new StringTag(mappedEnchantmentId + " " + EnchantmentRewriter.getRomanNumber(level))); noMapped.add(enchantmentEntry); } else if (!newId.isEmpty()) { - Short oldId = Protocol1_13To1_12_2.MAPPINGS.getOldEnchantmentsIds().inverse().get(newId); + Short oldId = Protocol1_13To1_12_2.MAPPINGS.getOldEnchantmentsIds().inverse().get(Key.stripMinecraftNamespace(newId)); if (oldId == null) { if (!newId.startsWith("viaversion:legacy/")) { // Custom enchant (?)