aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-04-10 12:40:58 +0200
committerGitHub <noreply@github.com>2024-04-10 12:40:58 +0200
commit5384d0bc1028b46d4ab1ace9608b2b72b5068255 (patch)
tree8767996973f30a9976cb4ba51c4383109a5219e2 /src/main/java
parentc09c456d72ef95aeddf9c3b93639af8c64552fd1 (diff)
downloadNotEnoughUpdates-5384d0bc1028b46d4ab1ace9608b2b72b5068255.tar.gz
NotEnoughUpdates-5384d0bc1028b46d4ab1ace9608b2b72b5068255.tar.bz2
NotEnoughUpdates-5384d0bc1028b46d4ab1ace9608b2b72b5068255.zip
Add Potions to ItemResolutionQuery (#1067)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java9
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index 82603cb7..cf95b081 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -895,7 +895,9 @@ public class NEUManager {
displayGuiItemRecipe(internalName);
break;
case "viewpotion":
- neu.sendChatMessage("/viewpotion " + internalName.split(";")[0].toLowerCase(Locale.ROOT));
+ String potionName = internalName.split(";")[0];
+ potionName = potionName.replace("POTION_", "");
+ neu.sendChatMessage("/viewpotion " + potionName.toLowerCase(Locale.ROOT));
break;
default:
displayGuiItemRecipe(internalName);
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);