aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-09-09 15:52:20 +0200
committerGitHub <noreply@github.com>2022-09-09 15:52:20 +0200
commitd203640d5296bde151596388aa6df332393d0a1c (patch)
treeefecc826c844620e586351454ea6cfcf811ce9e5 /src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java
parent8b53b538debb6285ab85877939b66f872c991f32 (diff)
downloadnotenoughupdates-d203640d5296bde151596388aa6df332393d0a1c.tar.gz
notenoughupdates-d203640d5296bde151596388aa6df332393d0a1c.tar.bz2
notenoughupdates-d203640d5296bde151596388aa6df332393d0a1c.zip
Fix item resolution query crashing on some enchant books (#262)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java4
1 files changed, 2 insertions, 2 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 1ff659ac..48eb6fad 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java
@@ -194,14 +194,14 @@ public class ItemResolutionQuery {
private String resolveEnchantedBookNameFromNBT() {
NBTTagCompound enchantments = getExtraAttributes().getCompoundTag("enchantments");
- String enchantName = Iterables.getOnlyElement(enchantments.getKeySet(), null);
+ String enchantName = IteratorUtils.getOnlyElement(enchantments.getKeySet(), null);
if (enchantName == null || enchantName.isEmpty()) return null;
return enchantName.toUpperCase(Locale.ROOT) + ";" + enchantments.getInteger(enchantName);
}
private String resolveRuneName() {
NBTTagCompound runes = getExtraAttributes().getCompoundTag("runes");
- String runeName = Iterables.getOnlyElement(runes.getKeySet(), null);
+ String runeName = IteratorUtils.getOnlyElement(runes.getKeySet(), null);
if (runeName == null || runeName.isEmpty()) return null;
return runeName.toUpperCase(Locale.ROOT) + "_RUNE;" + runes.getInteger(runeName);
}