Skip to content

Commit

Permalink
Fix old UNCRAFTABLE base potion conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Dec 23, 2024
1 parent 02f91d0 commit e8efb5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/laytonsmith/core/ObjectGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit e8efb5c

Please sign in to comment.