diff --git a/src/main/java/com/laytonsmith/abstraction/enums/MCPotionType.java b/src/main/java/com/laytonsmith/abstraction/enums/MCPotionType.java index 1261fa494..a5147a595 100644 --- a/src/main/java/com/laytonsmith/abstraction/enums/MCPotionType.java +++ b/src/main/java/com/laytonsmith/abstraction/enums/MCPotionType.java @@ -26,6 +26,8 @@ public static MCPotionType valueOf(String test) throws IllegalArgumentException MCVanillaPotionType oldType = MCVanillaPotionType.valueOf(test); if(oldType.rename != null) { return MAP.get(oldType.rename); + } else if(oldType == MCVanillaPotionType.UNCRAFTABLE) { + return null; } throw new IllegalArgumentException("Unknown potion type: " + test); } diff --git a/src/main/java/com/laytonsmith/core/ObjectGenerator.java b/src/main/java/com/laytonsmith/core/ObjectGenerator.java index 2b319a4e5..97c84af7b 100644 --- a/src/main/java/com/laytonsmith/core/ObjectGenerator.java +++ b/src/main/java/com/laytonsmith/core/ObjectGenerator.java @@ -2021,6 +2021,9 @@ public MCPotionType legacyPotionData(CArray potionArray, Target t) { } catch (IllegalArgumentException ex) { throw new CREFormatException("Invalid potion type: " + potionArray.get("type", t).val(), t); } + if(type == null) { + return null; + } boolean extended = false; boolean upgraded = false; if(potionArray.containsKey("extended")) {