From ac86d891fee282b80a2dab77f992ac58cd39d789 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 17 Mar 2024 19:58:05 +0100 Subject: [PATCH] Check if id is present in EnchantmentRewriter Closes #699 --- .../viabackwards/api/rewriters/EnchantmentRewriter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EnchantmentRewriter.java b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EnchantmentRewriter.java index 67ba509f..b67161f6 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EnchantmentRewriter.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EnchantmentRewriter.java @@ -86,6 +86,9 @@ public class EnchantmentRewriter { while (iterator.hasNext()) { CompoundTag enchantmentEntry = iterator.next(); StringTag idTag = enchantmentEntry.getStringTag("id"); + if (idTag == null) { + continue; + } String enchantmentId = idTag.getValue(); String remappedName = enchantmentMappings.get(enchantmentId);