Skip to content

Commit e8efb5c

Browse files
committed
Fix old UNCRAFTABLE base potion conversion
1 parent 02f91d0 commit e8efb5c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/java/com/laytonsmith/abstraction/enums/MCPotionType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public static MCPotionType valueOf(String test) throws IllegalArgumentException
2626
MCVanillaPotionType oldType = MCVanillaPotionType.valueOf(test);
2727
if(oldType.rename != null) {
2828
return MAP.get(oldType.rename);
29+
} else if(oldType == MCVanillaPotionType.UNCRAFTABLE) {
30+
return null;
2931
}
3032
throw new IllegalArgumentException("Unknown potion type: " + test);
3133
}

src/main/java/com/laytonsmith/core/ObjectGenerator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,6 +2021,9 @@ public MCPotionType legacyPotionData(CArray potionArray, Target t) {
20212021
} catch (IllegalArgumentException ex) {
20222022
throw new CREFormatException("Invalid potion type: " + potionArray.get("type", t).val(), t);
20232023
}
2024+
if(type == null) {
2025+
return null;
2026+
}
20242027
boolean extended = false;
20252028
boolean upgraded = false;
20262029
if(potionArray.containsKey("extended")) {

0 commit comments

Comments
 (0)