Only add dummy enchantment once

This commit is contained in:
Nassim Jahnke 2024-08-06 15:21:18 +02:00
parent b556e6528a
commit a8ef3c890a
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -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();