From a8ef3c890a46ed178d33d939df76d652f0e5deb5 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 6 Aug 2024 15:21:18 +0200 Subject: [PATCH] Only add dummy enchantment once --- .../v1_20_3to1_20_5/rewriter/StructuredDataConverter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/StructuredDataConverter.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/StructuredDataConverter.java index 16b241854..2a6cfcbd5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/StructuredDataConverter.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_3to1_20_5/rewriter/StructuredDataConverter.java @@ -390,6 +390,9 @@ public final class StructuredDataConverter { if (enchantmentsTag == null) { enchantmentsTag = new ListTag<>(CompoundTag.class); tag.put("Enchantments", enchantmentsTag); + } else if (!enchantmentsTag.isEmpty()) { + // If there already are enchantments, we don't need to add an invalid one + return; } final CompoundTag invalidEnchantment = new CompoundTag();