From f499c56d370d1c88cf005122da49f7633ced5918 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Thu, 8 Sep 2022 18:31:03 +0200 Subject: Fix item resolution query crashing on some enchant books --- src/main/java/at/hannibal2/skyhanni/utils/ItemResolutionQuery.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ItemResolutionQuery.java') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemResolutionQuery.java b/src/main/java/at/hannibal2/skyhanni/utils/ItemResolutionQuery.java index 1f8988613..548db2f08 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemResolutionQuery.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemResolutionQuery.java @@ -1,7 +1,6 @@ package at.hannibal2.skyhanni.utils; import at.hannibal2.skyhanni.config.ConfigManager; -import com.google.common.collect.Iterables; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import net.minecraft.client.Minecraft; @@ -155,14 +154,14 @@ public class ItemResolutionQuery { private String resolveEnchantedBookNameFromNBT() { NBTTagCompound enchantments = getExtraAttributes().getCompoundTag("enchantments"); - String enchantName = Iterables.getOnlyElement(enchantments.getKeySet(), null); + String enchantName = IteratorUtils.INSTANCE.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.INSTANCE.getOnlyElement(runes.getKeySet(), null); if (runeName == null || runeName.isEmpty()) return null; return runeName.toUpperCase(Locale.ROOT) + "_RUNE;" + runes.getInteger(runeName); } -- cgit