From 20eafeea6e1f904e114f4cae6bf0e202469322fa Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:23:06 +0000 Subject: Added the ability for abicases to work (#399) * Added the ability for abicases to work * this was a bug i noticed once --- .../java/io/github/moulberry/notenoughupdates/NEUManager.java | 1 + .../moulberry/notenoughupdates/util/ItemResolutionQuery.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 71aa10b6..5fe902fb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -1597,6 +1597,7 @@ public class NEUManager { recipes.clear(); recipesMap.clear(); usagesMap.clear(); + itemMap.clear(); File[] itemFiles = new File(repoLocation, "items").listFiles(); if (itemFiles != null) { 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 3692602a..ea5e13ab 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java @@ -116,6 +116,9 @@ public class ItemResolutionQuery { case "PARTY_HAT_CRAB_ANIMATED": resolvedName = resolveCrabHatName(); break; + case "ABICASE": + resolvedName = resolvePhoneCase(); + break; } } @@ -235,6 +238,11 @@ public class ItemResolutionQuery { return "PARTY_HAT_CRAB_" + color.toUpperCase(Locale.ROOT) + (crabHatYear == 2022 ? "_ANIMATED" : ""); } + private String resolvePhoneCase() { + String model = getExtraAttributes().getString("model"); + return "ABICASE_" + model.toUpperCase(Locale.ROOT); + } + private String resolveEnchantedBookNameFromNBT() { NBTTagCompound enchantments = getExtraAttributes().getCompoundTag("enchantments"); String enchantName = IteratorUtils.getOnlyElement(enchantments.getKeySet(), null); -- cgit