aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-04-15 19:00:23 +0200
committerGitHub <noreply@github.com>2024-04-15 19:00:23 +0200
commit668c3a37c3d7b0570f7da6fb1d4629680951cd55 (patch)
tree4a20787ed1ac16e2c8ee0d9d3ca4ebf1e7c4b871 /src/main
parentebdcfa85d35fd813c5cfd639a310b85e2d03a79f (diff)
downloadNotEnoughUpdates-668c3a37c3d7b0570f7da6fb1d4629680951cd55.tar.gz
NotEnoughUpdates-668c3a37c3d7b0570f7da6fb1d4629680951cd55.tar.bz2
NotEnoughUpdates-668c3a37c3d7b0570f7da6fb1d4629680951cd55.zip
meta: Fix Item Resolution Query not working correctly for dungeon potions (#1093)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java12
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() {