From 5384d0bc1028b46d4ab1ace9608b2b72b5068255 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Wed, 10 Apr 2024 12:40:58 +0200 Subject: Add Potions to ItemResolutionQuery (#1067) --- .../moulberry/notenoughupdates/util/ItemResolutionQuery.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java') 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 2cccce72..9d279824 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java @@ -126,6 +126,9 @@ public class ItemResolutionQuery { case "PARTY_HAT_SLOTH": resolvedName = resolveSlothHatName(); break; + case "POTION": + resolvedName = resolvePotionName(); + break; } } @@ -337,6 +340,12 @@ public class ItemResolutionQuery { } } + private String resolvePotionName() { + String potion = getExtraAttributes().getString("potion"); + int potionLvl = getExtraAttributes().getInteger("potion_level"); + return "POTION_" + potion.toUpperCase(Locale.ROOT) + ";" + potionLvl; + } + private NBTTagCompound getExtraAttributes() { if (compound == null) return new NBTTagCompound(); return compound.getCompoundTag(EXTRA_ATTRIBUTES); -- cgit