3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-20 06:50:10 +01:00

Ignore invalid enchantment tags

Fixes ViaVersion/ViaVersion#2693
Dieser Commit ist enthalten in:
Nassim Jahnke 2021-10-11 11:05:50 +02:00
Ursprung 3d6c31c479
Commit 71cc1ca4b5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -87,10 +87,10 @@ public class EnchantmentRewriter {
Iterator<Tag> iterator = enchantments.iterator(); Iterator<Tag> iterator = enchantments.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
CompoundTag enchantmentEntry = (CompoundTag) iterator.next(); CompoundTag enchantmentEntry = (CompoundTag) iterator.next();
StringTag idTag = enchantmentEntry.get("id"); Tag idTag = enchantmentEntry.get("id");
if (idTag == null) continue; if (!(idTag instanceof StringTag)) continue;
String enchantmentId = idTag.getValue(); String enchantmentId = ((StringTag) idTag).getValue();
String remappedName = enchantmentMappings.get(enchantmentId); String remappedName = enchantmentMappings.get(enchantmentId);
if (remappedName != null) { if (remappedName != null) {
if (!changed) { if (!changed) {