From 668c3a37c3d7b0570f7da6fb1d4629680951cd55 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:00:23 +0200 Subject: meta: Fix Item Resolution Query not working correctly for dungeon potions (#1093) --- .../moulberry/notenoughupdates/util/ItemResolutionQuery.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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() { -- cgit