3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 00:22:53 +01:00

Add sanity check to enchantment nbt check

Dieser Commit ist enthalten in:
KennyTV 2021-01-08 09:05:57 +01:00
Ursprung 1c4b27e56c
Commit 4a360bac44
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -63,7 +63,10 @@ public class EnchantmentRewriter {
ListTag remappedEnchantments = new ListTag(nbtTagName + "|" + key, CompoundTag.class); ListTag remappedEnchantments = new ListTag(nbtTagName + "|" + key, CompoundTag.class);
List<Tag> lore = new ArrayList<>(); List<Tag> lore = new ArrayList<>();
for (Tag enchantmentEntry : enchantments.clone()) { for (Tag enchantmentEntry : enchantments.clone()) {
String newId = (String) ((CompoundTag) enchantmentEntry).get("id").getValue(); Tag idTag = ((CompoundTag) enchantmentEntry).get("id");
if (idTag == null) continue;
String newId = (String) idTag.getValue();
String enchantmentName = enchantmentMappings.get(newId); String enchantmentName = enchantmentMappings.get(newId);
if (enchantmentName != null) { if (enchantmentName != null) {
enchantments.remove(enchantmentEntry); enchantments.remove(enchantmentEntry);