diff options
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java index 9d279824..27c04ca2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java @@ -343,7 +343,17 @@ public class ItemResolutionQuery { private String resolvePotionName() { String potion = getExtraAttributes().getString("potion"); int potionLvl = getExtraAttributes().getInteger("potion_level"); - return "POTION_" + potion.toUpperCase(Locale.ROOT) + ";" + potionLvl; + String potionName = getExtraAttributes().getString("potion_name"); + String potionType = getExtraAttributes().getString("potion_type"); + if (potionName != null && !potionName.isEmpty()) { + return "POTION_" + potionName.toUpperCase(Locale.ROOT) + ";" + potionLvl; + } else if (potion != null && !potion.isEmpty()) { + return "POTION_" + potion.toUpperCase(Locale.ROOT) + ";" + potionLvl; + } else if (potionType != null && !potionType.isEmpty()) { + return "POTION_" + potionType.toUpperCase(Locale.ROOT); + } else { + return "WATER_BOTTLE"; + } } private NBTTagCompound getExtraAttributes() { |