3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-25 07:40:08 +01:00

More sanity checks in legacy enchantment handling

Fixes #336
Dieser Commit ist enthalten in:
KennyTV 2021-03-01 18:25:31 +01:00
Ursprung 70a10132d0
Commit a8de222bc2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

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