diff options
57 files changed, 190 insertions, 170 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index c5f6c6e0a..165934ea0 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -51,7 +51,7 @@ class CollectionAPI { singleCounterPattern.matchMatcher(line) { val counter = group("amount").replace(",", "").toLong() val name = inventoryName.split(" ").dropLast(1).joinToString(" ") - val internalName = NEUItems.getInternalNameOrNull_new(name) ?: continue + val internalName = NEUItems.getInternalNameOrNull(name) ?: continue collectionValue[internalName] = counter } } @@ -75,7 +75,7 @@ class CollectionAPI { for (line in lore) { counterPattern.matchMatcher(line) { val counter = group("amount").replace(",", "").toLong() - val internalName = NEUItems.getInternalNameOrNull_new(name) ?: continue + val internalName = NEUItems.getInternalNameOrNull(name) ?: continue collectionValue[internalName] = counter } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt index 23352deee..f566c8d60 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.garden.CropAccessory import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import com.google.gson.JsonElement @@ -96,7 +96,7 @@ class CropAccessoryData { private fun bestCropAccessory(items: Iterable<ItemStack>): CropAccessory { - return items.mapNotNull { item -> CropAccessory.getByName(item.getInternalName()) } + return items.mapNotNull { item -> CropAccessory.getByName(item.getInternalName_old()) } .maxOrNull() ?: CropAccessory.NONE } diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt index db000fb25..d7371cfa6 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import net.minecraft.client.Minecraft @@ -71,7 +71,7 @@ class MinecraftData { fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return val hand = InventoryUtils.getItemInHand() - val newItem = hand?.getInternalName() ?: "" + val newItem = hand?.getInternalName_old() ?: "" if (newItem != InventoryUtils.itemInHandId) { ItemInHandChangeEvent(newItem, hand).postAndCatch() diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt index 5bae57ac5..55bb5585b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.OwnInventorItemUpdateEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName @@ -75,13 +75,13 @@ class OwnInventoryData { val diffWorld = System.currentTimeMillis() - LorenzUtils.lastWorldSwitch if (diffWorld < 3_000) return - val internalName = item.getInternalNameOrNull_new() + val internalName = item.getInternalNameOrNull() if (internalName == null) { LorenzUtils.debug("OwnInventoryData add is empty for: '$internalName'") return } - if (internalName.asString().startsWith("MAP-")) return + if (internalName.startsWith("MAP-")) return val (_, amount) = NEUItems.getMultiplier(internalName) if (amount > 1) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt index 097eb2dec..934e9bda0 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData import at.hannibal2.skyhanni.features.slayer.SlayerType -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.nextAfter @@ -56,7 +56,7 @@ object SlayerAPI { } fun getItemNameAndPrice(stack: ItemStack): Pair<String, Double> { - val internalName = stack.getInternalName_new() + val internalName = stack.getInternalName() val amount = stack.stackSize val key = internalName to amount nameCache.getIfPresent(key)?.let { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt index a989d60d1..783f79f49 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.bazaar import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName @@ -23,7 +23,7 @@ class BazaarApi { private var currentSearchedItem = "" fun getBazaarDataByName(name: String): BazaarData? = - NEUItems.getInternalNameOrNull(name)?.let { getBazaarDataByInternalName(it) } + NEUItems.getRawInternalNameOrNull(name)?.let { getBazaarDataByInternalName(it) } fun getBazaarDataByInternalName(internalName: String) = internalName.asInternalName().getBazaarData() @@ -31,7 +31,7 @@ class BazaarApi { holder.getData(this) } else null - fun isBazaarItem(stack: ItemStack) = isBazaarItem(stack.getInternalName()) + fun isBazaarItem(stack: ItemStack) = isBazaarItem(stack.getInternalName_old()) fun NEUInternalName.isBazaarItem() = NEUItems.manager.auctionManager.getBazaarInfo(asString()) != null diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt index a2106bf15..e37d14df8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.bazaar import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems @@ -39,14 +39,14 @@ class BazaarBestSellMethod { if (buyInstantly == null || buyInstantly.displayName != "§aBuy Instantly") return "" val bazaarItem = inv.getStackInSlot(13) ?: return "" - val internalName = NEUItems.getInternalNameOrNull(bazaarItem.displayName) ?: return "" + val internalName = NEUItems.getRawInternalNameOrNull(bazaarItem.displayName) ?: return "" var having = 0 for (slot in chest.inventorySlots) { if (slot == null) continue if (slot.slotNumber == slot.slotIndex) continue val stack = slot.stack ?: continue - if (internalName == stack.getInternalName()) { + if (internalName == stack.getInternalName_old()) { having += stack.stackSize } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 211fd94e5..ae956f2d8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.bingo import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.TitleUtils import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems @@ -90,7 +90,7 @@ class MinionCraftHelper { for (item in mainInventory) { val name = item?.name?.removeColor() ?: continue - val rawId = item.getInternalName() + val rawId = item.getInternalName_old() if (isMinionName(name)) { minions[name] = rawId } @@ -101,7 +101,7 @@ class MinionCraftHelper { for (item in mainInventory) { val name = item?.name?.removeColor() ?: continue - val rawId = item.getInternalName() + val rawId = item.getInternalName_old() if (!isMinionName(name)) { if (!allIngredients.contains(rawId)) continue if (!isAllowed(allMinions, rawId)) continue @@ -269,7 +269,7 @@ class MinionCraftHelper { val name = b.name ?: continue if (!name.startsWith("§e")) continue - val internalName = NEUItems.getInternalName("$name I").replace("MINION", "GENERATOR").replace(";", "_") + val internalName = NEUItems.getRawInternalName("$name I").replace("MINION", "GENERATOR").replace(";", "_") if (!tierOneMinionsDone.contains(internalName)) { tierOneMinionsDone.add(internalName) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt index 892bedcd1..bfa081288 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/nextstep/CollectionStep.kt @@ -5,5 +5,5 @@ import at.hannibal2.skyhanni.utils.NumberUtil class CollectionStep(collectionName: String, amountNeeded: Int) : ProgressionStep(NumberUtil.format(amountNeeded) + " $collectionName Collection", amountNeeded.toLong()) { - val internalName = NEUItems.getInternalName_new(collectionName) + val internalName = NEUItems.getInternalName(collectionName) }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt index f8bf9943d..0b7097091 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.toLorenzVec @@ -183,7 +183,7 @@ class GriffinBurrowParticleFinder { } private val ItemStack.isSpade - get() = this.getInternalName() == "ANCESTRAL_SPADE" + get() = getInternalName_old() == "ANCESTRAL_SPADE" class Burrow( var location: LorenzVec, diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt index 69c65aa15..18dfc5d7d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil @@ -16,7 +16,7 @@ class TrophyFishFillet { fun onTooltip(event: LorenzToolTipEvent) { if (!isEnabled()) return if (event.slot.inventory.name.contains("Sack")) return - val internalName = event.itemStack.getInternalName() + val internalName = event.itemStack.getInternalName_old() val trophyFishName = internalName.substringBeforeLast("_") .replace("_", "").lowercase() val trophyRarityName = internalName.substringAfterLast("_") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt index 1a761f0ae..20b9cacdb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorFeatures import at.hannibal2.skyhanni.utils.ItemUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils @@ -76,9 +76,9 @@ class AnitaMedalProfit { val (name, amount) = ItemUtils.readItemAmount(itemName) if (name == null) return - var internalName = NEUItems.getInternalNameOrNull(name) + var internalName = NEUItems.getRawInternalNameOrNull(name) if (internalName == null) { - internalName = item.getInternalName() + internalName = item.getInternalName_old() } val itemPrice = NEUItems.getPrice(internalName) * amount @@ -105,7 +105,7 @@ class AnitaMedalProfit { val bronze = medal.factorBronze * amount bronze * jacobTicketPrice } else { - val internalName = NEUItems.getInternalName(name) + val internalName = NEUItems.getRawInternalName(name) NEUItems.getPrice(internalName) * amount } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index 8465ded13..4b64ce4fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.garden.CropType.Companion.getTurboCrop import at.hannibal2.skyhanni.features.garden.GardenAPI.addCropIcon import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList @@ -158,7 +158,7 @@ class FarmingFortuneDisplay { var greenThumbFortune = 0.0 fun getToolFortune(tool: ItemStack?): Double { - val internalName = tool?.getInternalName() ?: return 0.0 + val internalName = tool?.getInternalName_old() ?: return 0.0 if (internalName == "THEORETICAL_HOE") { return 0.0 } @@ -212,7 +212,7 @@ class FarmingFortuneDisplay { val armorAbilityFortune = "§7.*§7Grants §6(?<bonus>.*)☘.*".toPattern() var pieces = 0 for (line in item?.getLore()!!) { - if (item.getInternalName().contains("LOTUS")) { + if (item.getInternalName_old().contains("LOTUS")) { lotusAbilityPattern.matchMatcher(line) { return group("bonus").toDouble() } @@ -239,9 +239,9 @@ class FarmingFortuneDisplay { displayedFortune = match[1]!!.value.toDouble() reforgeFortune = match[2]?.value?.toDouble() ?: 0.0 - itemBaseFortune = if (tool.getInternalName().contains("LOTUS")) 5.0 + itemBaseFortune = if (tool.getInternalName_old().contains("LOTUS")) 5.0 else displayedFortune - reforgeFortune - enchantmentFortune - (tool.getFarmingForDummiesCount() ?: 0 ) * 1.0 - greenThumbFortune = if (tool.getInternalName().contains("LOTUS")) { + greenThumbFortune = if (tool.getInternalName_old().contains("LOTUS")) { displayedFortune - reforgeFortune - itemBaseFortune } else 0.0 } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 64952a625..083770c6f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -12,7 +12,7 @@ import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed import at.hannibal2.skyhanni.features.garden.inventory.SkyMartCopperPrice import at.hannibal2.skyhanni.utils.BlockUtils.isBabyCrop import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec @@ -103,7 +103,7 @@ object GardenAPI { private fun getToolInHand(toolItem: ItemStack?, crop: CropType?): String? { if (crop != null) return crop.cropName - val internalName = toolItem?.getInternalName() ?: return null + val internalName = toolItem?.getInternalName_old() ?: return null return if (isOtherTool(internalName)) internalName else null } @@ -126,7 +126,7 @@ object GardenAPI { fun inGarden() = LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.GARDEN fun ItemStack.getCropType(): CropType? { - val internalName = getInternalName() + val internalName = getInternalName_old() return CropType.entries.firstOrNull { internalName.startsWith(it.toolName) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt index 4e578e6f7..c9350e6c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay.Companion.getAbilityFortune import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName @@ -139,7 +139,7 @@ class ToolTooltipTweaks { } // Fixing a hypixel bug. TODO remove once hypixel fixes it. - if (itemStack.getInternalName().contains("LOTUS")) { + if (itemStack.getInternalName_old().contains("LOTUS")) { event.toolTip.replaceAll { it.replace("Kills:", "Visitors:") } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt index 67e6f0197..287c1d4bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt @@ -44,10 +44,12 @@ class GardenComposterInventoryFeatures { LorenzUtils.error("§c[SkyHanni] Could not read item '$line'") continue } - val internalName = NEUItems.getInternalNameOrNull(itemName) + val internalName = NEUItems.getRawInternalNameOrNull(itemName) if (internalName == null) { - LorenzUtils.chat("§c[SkyHanni] Error reading internal name for item '$itemName§c' " + - "(in GardenComposterInventoryFeatures)") + LorenzUtils.chat( + "§c[SkyHanni] Error reading internal name for item '$itemName§c' " + + "(in GardenComposterInventoryFeatures)" + ) continue } val lowestBin = NEUItems.getPrice(internalName) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index 1adbdf498..512610b2e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -14,7 +14,7 @@ import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.isSpeedDataEmpty import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList @@ -130,7 +130,7 @@ object CropMoneyDisplay { extraMushroomCowPerkCoins = perSecond * 60 * 60 } - if (InventoryUtils.getItemInHand()?.getInternalName() + if (InventoryUtils.getItemInHand()?.getInternalName_old() ?.contains("DICER") == true && config.moneyPerHourDicer ) { var dicerDrops = 0.0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt index ea685338f..63d1a39a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings @@ -102,7 +102,7 @@ class FarmingArmorDrops { private fun checkArmor() { val armorPieces = InventoryUtils.getArmor() - .mapNotNull { it?.getInternalName() } + .mapNotNull { it?.getInternalName_old() } .count { armorPattern.matcher(it).matches() } hasArmor = armorPieces > 1 } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt index b7c019475..c6ecce63c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt @@ -12,7 +12,7 @@ import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import com.google.gson.JsonObject import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -101,7 +101,7 @@ object GardenCropSpeed { } else 0.0 GardenAPI.getCurrentlyFarmedCrop()?.let { val heldTool = InventoryUtils.getItemInHand() - val toolName = heldTool?.getInternalName() + val toolName = heldTool?.getInternalName_old() if (toolName?.contains("DICER") == true) { val lastCrop = lastBrokenCrop?.cropName?.lowercase() ?: "NONE" if (toolName.lowercase().contains(lastCrop)) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt index 507aa229b..9c2d38e4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.OwnInventorItemUpdateEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ItemBlink -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems @@ -33,7 +33,7 @@ class WildStrawberryDyeNotification { val diff = System.currentTimeMillis() - lastCloseTime if (diff < 1_000) return@execute - val internalName = event.itemStack.getInternalName() + val internalName = event.itemStack.getInternalName_old() if (internalName == "DYE_WILD_STRAWBERRY") { val name = event.itemStack.name!! TitleUtils.sendTitle(name, 5_000) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index c9c645429..33846d630 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal @@ -44,7 +44,7 @@ class CaptureFarmingGear { val resultList = mutableListOf<String>() val itemStack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem() ?: return - val itemID = itemStack.getInternalName() + val itemID = itemStack.getInternalName_old() resultList.add(itemStack.displayName.toString()) resultList.add(itemID) @@ -62,7 +62,7 @@ class CaptureFarmingGear { } for (armor in InventoryUtils.getArmor()) { if (armor == null) continue - val split = armor.getInternalName().split("_") + val split = armor.getInternalName_old().split("_") if (split.first() in farmingSets) { for (item in FarmingItems.entries) { if (item.name == split.last()) { @@ -92,7 +92,7 @@ class CaptureFarmingGear { val outdatedItems = outdatedItems ?: return if (event.inventoryName == "Your Equipment and Stats") { for ((_, slot) in event.inventoryItems) { - val split = slot.getInternalName().split("_") + val split = slot.getInternalName_old().split("_") if (split.first() == "LOTUS") { for (item in FarmingItems.entries) { if (item.name == split.last()) { @@ -117,7 +117,7 @@ class CaptureFarmingGear { var highestRabbitLvl = -1 for ((_, item) in event.inventoryItems) { - val split = item.getInternalName().split(";") + val split = item.getInternalName_old().split(";") if (split.first() == "ELEPHANT") { if (split.last().toInt() > highestElephantLvl) { farmingItems[FarmingItems.ELEPHANT] = item diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt index 26a649aa1..5eed793aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetItem import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel @@ -16,7 +17,8 @@ import net.minecraft.item.ItemStack object FFStats { private val toolHasBountiful get() = GardenAPI.config?.toolWithBountiful - private val mathCrops = listOf(CropType.WHEAT, CropType.CARROT, CropType.POTATO, CropType.SUGAR_CANE, CropType.NETHER_WART) + private val mathCrops = + listOf(CropType.WHEAT, CropType.CARROT, CropType.POTATO, CropType.SUGAR_CANE, CropType.NETHER_WART) private val dicerCrops = listOf(CropType.PUMPKIN, CropType.MELON) private val farmingBoots = arrayListOf("RANCHERS_BOOTS", "FARMER_BOOTS") @@ -49,7 +51,7 @@ object FFStats { val cropPage = mutableMapOf<FortuneStats, Pair<Double, Double>>() fun loadFFData() { - cakeExpireTime = GardenAPI.config?.fortune?.cakeExpiring ?: -1L + cakeExpireTime = GardenAPI.config?.fortune?.cakeExpiring ?: -1L getEquipmentFFData(FarmingItems.NECKLACE.getItem(), necklaceFF) getEquipmentFFData(FarmingItems.CLOAK.getItem(), cloakFF) @@ -71,7 +73,7 @@ object FFStats { { it.second }).map { (key, values) -> key to values.sum() } .toMap() as MutableMap<FFTypes, Double> - usingSpeedBoots = FarmingItems.BOOTS.getItem().getInternalName() in farmingBoots + usingSpeedBoots = FarmingItems.BOOTS.getItem().getInternalName_old() in farmingBoots getPetFFData(FarmingItems.ELEPHANT.getItem(), elephantFF) getPetFFData(FarmingItems.MOOSHROOM_COW.getItem(), mooshroomFF) @@ -106,6 +108,7 @@ object FFStats { cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 20.0) } } + in dicerCrops -> { cropPage[FortuneStats.SUNDER] = Pair(FarmingFortuneDisplay.getSunderFortune(tool), 62.5) if (toolHasBountiful?.get(crop) == true) { @@ -114,6 +117,7 @@ object FFStats { cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 20.0) } } + CropType.MUSHROOM -> { cropPage[FortuneStats.BASE_TOOL] = Pair(FarmingFortuneDisplay.getToolFortune(tool), 30.0) cropPage[FortuneStats.HARVESTING] = Pair(FarmingFortuneDisplay.getHarvestingFortune(tool), 75.0) @@ -123,6 +127,7 @@ object FFStats { cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 13.0) } } + CropType.COCOA_BEANS -> { cropPage[FortuneStats.BASE_TOOL] = Pair(FarmingFortuneDisplay.getToolFortune(tool), 20.0) cropPage[FortuneStats.SUNDER] = Pair(FarmingFortuneDisplay.getSunderFortune(tool), 62.5) @@ -132,6 +137,7 @@ object FFStats { cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 16.0) } } + CropType.CACTUS -> { cropPage[FortuneStats.HARVESTING] = Pair(FarmingFortuneDisplay.getHarvestingFortune(tool), 75.0) if (toolHasBountiful?.get(crop) == true) { @@ -140,6 +146,7 @@ object FFStats { cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 16.0) } } + else -> {} } @@ -147,7 +154,7 @@ object FFStats { cropPage.toList().sumOf { it.second.first }, cropPage.toList().sumOf { it.second.second }) - if (tool.getInternalName().contains("DICER")){ + if (tool.getInternalName_old().contains("DICER")) { cropPage[FortuneStats.DICER] = Pair(33.0, 33.0) } } @@ -206,12 +213,15 @@ object FFStats { FarmingItems.ELEPHANT -> { petList = elephantFF } + FarmingItems.MOOSHROOM_COW -> { petList = mooshroomFF } + FarmingItems.RABBIT -> { petList = rabbitFF } + else -> {} } currentPetItem = FFGuideGUI.currentPet.getItem().getPetItem().toString() @@ -222,15 +232,16 @@ object FFStats { .toMap() as MutableMap<FFTypes, Double> } - private fun getPetFF (pet: ItemStack): Double { + private fun getPetFF(pet: ItemStack): Double { val petLevel = pet.getPetLevel() val strength = (GardenAPI.config?.fortune?.farmingStrength) if (strength != null) { - return if (pet.getInternalName().contains("ELEPHANT;4")) { + val rawInternalName = pet.getInternalName() + return if (rawInternalName.contains("ELEPHANT;4")) { 1.8 * petLevel - } else if (pet.getInternalName().contains("MOOSHROOM_COW;4")) { + } else if (rawInternalName.contains("MOOSHROOM_COW;4")) { (10 + petLevel).toDouble() + strength / (40 - petLevel * .2) - } else if (pet.getInternalName().contains("MOOSHROOM")) { + } else if (rawInternalName.contains("MOOSHROOM")) { (10 + petLevel).toDouble() } else 0.0 } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt index beda557e3..2c1d66ba1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt @@ -11,7 +11,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.currentPet import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarity import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil.addSuffix @@ -82,7 +82,7 @@ object FortuneUpgrades { for (piece in equipment) { val item = piece.getItem() //todo tell them to buy the missing item - if (!item.getInternalName().contains("LOTUS")) return + if (!item.getInternalName_old().contains("LOTUS")) return val enchantments = item.getEnchantments() ?: emptyMap() val greenThumbLvl = enchantments["green_thumb"] ?: 0 if (greenThumbLvl != 5 && visitors != 0.0) { @@ -123,7 +123,7 @@ object FortuneUpgrades { //todo needs to be called when switching pets private fun getPetUpgrades() { - if (currentPet.getItem().getInternalName().contains(";")) { + if (currentPet.getItem().getInternalName_old().contains(";")) { when (FFStats.currentPetItem) { "GREEN_BANDANA" -> {} "YELLOW_BANDANA" -> { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt index e97da2f38..759bbaa1d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt @@ -33,7 +33,7 @@ class GardenNextPlotPrice { if (next) { val (itemName, amount) = ItemUtils.readItemAmount(line) if (itemName != null) { - val lowestBin = NEUItems.getPrice(NEUItems.getInternalName(itemName)) + val lowestBin = NEUItems.getPrice(NEUItems.getRawInternalName(itemName)) val price = lowestBin * amount val format = NumberUtil.format(price) list[i] = list[i] + " §7(§6$format§7)" diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt index 1f7330eb9..046a56d7a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.features.garden.GardenAPI -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils.chat import at.hannibal2.skyhanni.utils.NEUItems @@ -118,7 +118,7 @@ object GardenPlotIcon { return } val copyStack = copyStack ?: return - plotList[event.slotId] = copyStack.getInternalName() + plotList[event.slotId] = copyStack.getInternalName_old() cachedStack[event.slotId] = copyStack } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt index 5073f4d95..7b88c5cec 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.garden.GardenAPI -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils @@ -34,7 +34,7 @@ class SkyMartCopperPrice { val table = mutableMapOf<Pair<String, String>, Pair<Double, String>>() for (stack in event.inventoryItems.values) { for (line in stack.getLore()) { - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_old() val lowestBin = NEUItems.getPrice(internalName) if (lowestBin == -1.0) continue pattern.matchMatcher(line) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index c688b1ff3..2b029d8c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -11,13 +11,12 @@ import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getItemNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList -import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import at.hannibal2.skyhanni.utils.NEUItems.getPrice import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -115,7 +114,7 @@ class GardenVisitorFeatures { LorenzUtils.error("§c[SkyHanni] Could not read item '$line'") continue } - val internalName = NEUItems.getInternalName(itemName) + val internalName = NEUItems.getRawInternalName(itemName) visitor.items[internalName] = amount } @@ -236,7 +235,7 @@ class GardenVisitorFeatures { list.add("§7(§fAny§7)") } else { for (item in items) { - val internalName = NEUItems.getInternalNameOrNull_new(item) + val internalName = NEUItems.getInternalNameOrNull(item) if (internalName != null) { list.add(internalName.getItemStack()) } else { @@ -373,9 +372,9 @@ class GardenVisitorFeatures { val formattedLine = line.substring(4) val (itemName, amount) = ItemUtils.readItemAmount(formattedLine) if (itemName != null) { - var internalName = NEUItems.getInternalNameOrNull_new(itemName) + var internalName = NEUItems.getInternalNameOrNull(itemName) if (internalName != null) { - internalName = internalName.asString().replace("◆_", "").asInternalName() + internalName = internalName.replace("◆_", "") price = internalName.getPrice() * amount if (config.visitorShowPrice) { @@ -649,7 +648,7 @@ class GardenVisitorFeatures { private fun hasItemsInInventory(visitor: Visitor): Boolean { var ready = true for ((internalName, need) in visitor.items) { - val having = InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName } + val having = InventoryUtils.countItemsInLowerInventory { it.getInternalName_old() == internalName } if (having < need) { ready = false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 64779d644..18147fb2f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -13,7 +13,7 @@ import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.cleanName -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.isEnchanted import at.hannibal2.skyhanni.utils.ItemUtils.isVanilla @@ -221,7 +221,7 @@ class HideNotClickableItems { reverseColor = true - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_old() if (internalName == ComposterOverlay.currentOrganicMatterItem) { return false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt index 4892546bf..ba0952451 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.RenderUtils.highlight import at.hannibal2.skyhanni.utils.RenderUtils.interpolate import net.minecraft.item.ItemStack @@ -46,7 +46,7 @@ class HighlightBonzoMasks { } private fun maskType(item: ItemStack): String? { - return when (item.getInternalName()) { + return when (item.getInternalName_old()) { "STARRED_BONZO_MASK" -> "BONZO_MASK" "BONZO_MASK" -> "BONZO_MASK" "SPIRIT_MASK" -> "SPIRIT_MASK" diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index 6fdb3800d..029ca979f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.between @@ -163,7 +163,7 @@ class ItemDisplayOverlayFeatures { } if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(12)) { - if (item.getInternalName() == "LARVA_HOOK") { + if (item.getInternalName_old() == "LARVA_HOOK") { for (line in item.getLore()) { "§7§7You may harvest §6(?<amount>.).*".toPattern().matchMatcher(line) { val amount = group("amount").toInt() @@ -178,7 +178,7 @@ class ItemDisplayOverlayFeatures { } if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(13)) { - if (item.getInternalName() == "POTION") { + if (item.getInternalName_old() == "POTION") { item.name?.let { "Dungeon (?<level>.*) Potion".toPattern().matchMatcher(it.removeColor()) { return when (val level = group("level").romanToDecimal()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt index 8cff86bba..b590cbbe2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils @@ -119,7 +119,7 @@ class SackDisplay { numPattern.matchMatcher(line) { val stored = group("stored") val total = group("total") - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_old() item.internalName = internalName item.colorCode = group("color") item.stored = stored diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt index e64a56ed5..cc38ecbc3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.BlockClickEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor import at.hannibal2.skyhanni.utils.RenderUtils @@ -33,7 +33,7 @@ class FireVeilWandParticles { if (!LorenzUtils.inSkyBlock) return if (event.clickType == ClickType.RIGHT_CLICK) { - val internalName = event.itemInHand?.getInternalName() ?: return + val internalName = event.itemInHand?.getInternalName_old() ?: return if (internalName == "FIRE_VEIL_WAND") { lastClick = System.currentTimeMillis() diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index 330240ceb..7074f38a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.between @@ -43,7 +43,7 @@ class ItemAbilityCooldown { ItemAbility.GYROKINETIC_WAND_LEFT.sound() } if (event.pitch == 1f && event.volume == 1f) { - val internalName = InventoryUtils.getItemInHand()?.getInternalName() ?: return + val internalName = InventoryUtils.getItemInHand()?.getInternalName_old() ?: return if (!internalName.equalsOneOf("SHADOW_FURY", "STARRED_SHADOW_FURY")) return ItemAbility.SHADOW_FURY.sound() @@ -154,7 +154,7 @@ class ItemAbilityCooldown { private fun handleItemClick(itemInHand: ItemStack?) { if (!LorenzUtils.inSkyBlock) return - itemInHand?.getInternalName()?.run { + itemInHand?.getInternalName_old()?.run { ItemAbility.getByInternalName(this)?.setItemClick() } } @@ -318,7 +318,7 @@ class ItemAbilityCooldown { private fun hasAbility(stack: ItemStack): MutableList<ItemAbility> { val itemName: String = stack.cleanName() - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_old() val list = mutableListOf<ItemAbility>() for (ability in ItemAbility.entries) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt index 05aefc1f4..1615838ae 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.api.CollectionAPI import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.MinionOpenEvent import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -21,7 +21,7 @@ class MinionCollectLogic { private fun count(): MutableMap<NEUInternalName, Int> { val map = mutableMapOf<NEUInternalName, Int>() for (stack in InventoryUtils.getItemsInOwnInventory()) { - val internalName = stack.getInternalName_new() + val internalName = stack.getInternalName() val (newId, amount) = NEUItems.getMultiplier(internalName) val old = map[newId] ?: 0 map[newId] = old + amount * stack.stackSize diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt index d76bc538f..e8d453066 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt @@ -154,7 +154,7 @@ class CityProjectFeatures { val (name, amount) = ItemUtils.readItemAmount(line) if (name != null) { - val internalName = NEUItems.getInternalName(name) + val internalName = NEUItems.getRawInternalName(name) val old = materials.getOrPut(internalName) { 0 } materials[internalName] = old + amount } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt index 741a1a089..786c2bc1d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.api.CollectionAPI import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName @@ -138,7 +138,7 @@ class CollectionTracker { } private fun countCurrentlyInInventory() = - InventoryUtils.countItemsInLowerInventory { it.getInternalName_new() == internalName } + InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName } fun handleTabComplete(command: String): List<String>? { if (command != "shtrackcollection") return null diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt index 67883f422..b32f19015 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRecipientName import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -14,7 +14,7 @@ class RestorePieceOfWizardPortalLore { fun onTooltip(event: LorenzToolTipEvent) { if (!config.restorePieceOfWizardPortalLore) return val stack = event.itemStack - if (stack.getInternalName() != "WIZARD_PORTAL_MEMENTO") return + if (stack.getInternalName_old() != "WIZARD_PORTAL_MEMENTO") return val recipient = stack.getRecipientName() ?: return if (!event.toolTip[5].contains(recipient)) { event.toolTip.add(5, "§7Earned by: $recipient") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index a7730e257..2027e68ce 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.RenderItemTooltipEvent import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull_new -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getItemName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils @@ -101,20 +101,19 @@ object EstimatedItemValue { } private fun draw(stack: ItemStack): List<List<Any>> { - val internalName = stack.getInternalNameOrNull_new() ?: return listOf() + val internalName = stack.getInternalNameOrNull() ?: return listOf() - val rawInternalName = internalName.asString() // FIX neu item list - if (rawInternalName.startsWith("ULTIMATE_ULTIMATE_")) return listOf() + if (internalName.startsWith("ULTIMATE_ULTIMATE_")) return listOf() // We don't need this feature to work on books at all if (stack.item == Items.enchanted_book) return listOf() // Block catacombs items in mort inventory - if (rawInternalName.startsWith("CATACOMBS_PASS_") || rawInternalName.startsWith("MASTER_CATACOMBS_PASS_")) return listOf() + if (internalName.startsWith("CATACOMBS_PASS_") || internalName.startsWith("MASTER_CATACOMBS_PASS_")) return listOf() // Blocks the dungeon map - if (rawInternalName.startsWith("MAP-")) return listOf() + if (internalName.startsWith("MAP-")) return listOf() // Hides the rune item - if (rawInternalName.contains("_RUNE;")) return listOf() - if (rawInternalName.contains("UNIQUE_RUNE")) return listOf() + if (internalName.contains("_RUNE;")) return listOf() + if (internalName.contains("UNIQUE_RUNE")) return listOf() if (internalName.getItemStackOrNull() == null) { @@ -186,7 +185,7 @@ object EstimatedItemValue { private fun addAttributeCost(stack: ItemStack, list: MutableList<String>): Double { val attributes = stack.getAttributes() ?: return 0.0 - var internalName = stack.getInternalName().removePrefix("VANQUISHED_") + var internalName = stack.getInternalName_old().removePrefix("VANQUISHED_") val kuudraSets = listOf("AURORA", "CRIMSON", "TERROR", "HOLLOW") var genericName = internalName if (kuudraSets.any { internalName.contains(it) } @@ -374,7 +373,7 @@ object EstimatedItemValue { private fun addSilex(stack: ItemStack, list: MutableList<String>): Double { val tier = stack.getSilexCount() ?: return 0.0 - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_old() val maxTier = if (internalName == "STONK_PICKAXE") 4 else 5 val wtfHardcodedSilex = "SIL_EX".asInternalName() @@ -504,14 +503,14 @@ object EstimatedItemValue { } private fun addBaseItem(stack: ItemStack, list: MutableList<String>): Double { - val internalName = stack.getInternalName_new() + val internalName = stack.getInternalName() var price = internalName.getPrice() if (price == -1.0) { price = 0.0 } val name = internalName.getItemName() - if (internalName.asString().startsWith("ENCHANTED_BOOK_BUNDLE_")) { + if (internalName.startsWith("ENCHANTED_BOOK_BUNDLE_")) { list.add("§7Base item: $name") return 0.0 } @@ -537,7 +536,7 @@ object EstimatedItemValue { "ZOMBIE_COMMANDER_WHIP", ) - val internalName = stack.getInternalName() + val internalName = stack.getInternalName_old() for ((rawName, rawLevel) in enchantments) { // efficiency 1-5 is cheap, 6-10 is handled by silex if (rawName == "efficiency") continue diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt index 15ff1c658..d15eeb3be 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.rift import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.features.RiftConfig import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName import net.minecraft.item.ItemStack @@ -17,7 +17,7 @@ object RiftAPI { var motesPrice = emptyMap<NEUInternalName, Double>() fun ItemStack.motesNpcPrice(): Double? { - val baseMotes = motesPrice[getInternalName_new()] ?: return null + val baseMotes = motesPrice[getInternalName()] ?: return null val burgerStacks = config.motes.burgerStacks val pricePer = baseMotes + (burgerStacks * 5) * baseMotes / 100 return pricePer * stackSize diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt index 8c7ca46a4..78e95fa84 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.EntityUtils.getEntities import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -31,7 +31,7 @@ class RiftLarva { } private fun checkHand() { - hasHookInHand = InventoryUtils.getItemInHand()?.getInternalName() == "LARVA_HOOK" + hasHookInHand = InventoryUtils.getItemInHand()?.getInternalName_old() == "LARVA_HOOK" } private fun findLarvas() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt index 1df1ea82f..33bf4aebc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -24,7 +24,7 @@ class RiftAgaricusCap { } private fun updateLocation(): LorenzVec? { - if (InventoryUtils.getItemInHand()?.getInternalName() != "FARMING_WAND") return null + if (InventoryUtils.getItemInHand()?.getInternalName_old() != "FARMING_WAND") return null val currentLocation = BlockUtils.getBlockLookingAt() ?: return null when (currentLocation.getBlockStateAt().toString()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt index fae8f61ce..3dcf22b6b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy @@ -40,7 +40,7 @@ class RiftWiltedBerberisHelper { list = list.editCopy { removeIf { System.currentTimeMillis() > it.lastTime + 500 } } - hasFarmingToolInHand = InventoryUtils.getItemInHand()?.getInternalName()?.let { + hasFarmingToolInHand = InventoryUtils.getItemInHand()?.getInternalName_old()?.let { it == "FARMING_WAND" } ?: false diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt index d58eafd0e..30a7afa99 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import at.hannibal2.skyhanni.utils.LorenzColor @@ -34,7 +34,7 @@ class KloonHacking { } private fun checkHelmet() { - wearingHelmet = InventoryUtils.getArmor()[3]?.getInternalName() == "RETRO_ENCABULATING_VISOR" + wearingHelmet = InventoryUtils.getArmor()[3]?.getInternalName_old() == "RETRO_ENCABULATING_VISOR" } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt index b7728663f..6775230b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.EntityUtils.getEntities import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -31,7 +31,7 @@ class RiftOdonata { } private fun checkHand() { - hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName() == "EMPTY_ODONATA_BOTTLE" + hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName_old() == "EMPTY_ODONATA_BOTTLE" } private fun findOdonatas() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt index 310f22b80..1418f8f4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList @@ -84,7 +84,7 @@ object CruxTalismanDisplay { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return if (!event.repeatSeconds(2)) return - if (!InventoryUtils.getItemsInOwnInventory().any { it.getInternalName().startsWith(partialName) }) return + if (!InventoryUtils.getItemsInOwnInventory().any { it.getInternalName_old().startsWith(partialName) }) return displayLine.clear() bonusesLine.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt index 25bafb299..9e06b5015 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addSelector @@ -99,12 +99,12 @@ class ShowMotesNpcSellPrice { itemMap.clear() for ((index, stack) in stacks) { val itemValue = stack.motesNpcPrice() ?: continue - if (itemMap.contains(stack.getInternalName())) { - val (oldIndex, oldValue) = itemMap[stack.getInternalName()] ?: return + if (itemMap.contains(stack.getInternalName_old())) { + val (oldIndex, oldValue) = itemMap[stack.getInternalName_old()] ?: return oldIndex.add(index) - itemMap[stack.getInternalName()] = Pair(oldIndex, oldValue + itemValue) + itemMap[stack.getInternalName_old()] = Pair(oldIndex, oldValue + itemValue) } else { - itemMap[stack.getInternalName()] = Pair(mutableListOf(index), itemValue) + itemMap[stack.getInternalName_old()] = Pair(mutableListOf(index), itemValue) } } inInventory = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt index d67390349..57a7a5621 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt @@ -10,7 +10,7 @@ import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData import at.hannibal2.skyhanni.features.bazaar.BazaarData import at.hannibal2.skyhanni.test.PriceSource import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addSelector @@ -135,7 +135,7 @@ object SlayerItemProfitTracker { val itemStack = item.entityItem val name = itemStack.name ?: return if (SlayerAPI.ignoreSlayerDrop(name)) return - val internalName = itemStack.getInternalNameOrNull_new() ?: return + val internalName = itemStack.getInternalNameOrNull() ?: return val (itemName, price) = SlayerAPI.getItemNameAndPrice(itemStack) addItemPickup(internalName, itemStack.stackSize) diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemsOnGround.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemsOnGround.kt index e8b5204c3..375b2e86c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemsOnGround.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemsOnGround.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.slayer import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.utils.EntityUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -40,7 +40,7 @@ class SlayerItemsOnGround { if (SlayerAPI.ignoreSlayerDrop(name)) continue // happens in spiders den sometimes if (itemStack.item == Items.spawn_egg) continue - if (itemStack.getInternalName() == "") continue + if (itemStack.getInternalName_old() == "") continue val (itemName, price) = SlayerAPI.getItemNameAndPrice(itemStack) if (config.minimumPrice > price) continue diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt index fb72cc33d..371aa5337 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.data.TitleUtils import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils @@ -127,7 +127,7 @@ class SlayerRngMeterDisplay { } else { storage.itemGoal = selectedItem.nameWithEnchantment val jsonObject = Constants.RNGSCORE["slayer"].asJsonObject.get(getCurrentSlayer()).asJsonObject - storage.goalNeeded = jsonObject.get(selectedItem.getInternalName()).asLong + storage.goalNeeded = jsonObject.get(selectedItem.getInternalName_old()).asLong } update() } diff --git a/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt b/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt index cb48c803e..cafb99635 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull_new +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.MultiFilter @@ -37,7 +37,7 @@ class HighlightMissingRepoItems { private fun highlightItems(slots: Iterable<Slot>) { if (NEUItems.allInternalNames.isEmpty()) return for (slot in slots) { - val internalName = slot.stack?.getInternalNameOrNull_new() ?: continue + val internalName = slot.stack?.getInternalNameOrNull() ?: continue if (NEUItems.allInternalNames.contains(internalName)) continue if (ignoreItems.match(internalName.asString())) continue diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt index a4298046f..a3ddcafd0 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt @@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.features.dungeon.DungeonData import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorColorNames import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import net.minecraft.nbt.NBTTagCompound @@ -94,7 +94,7 @@ class SkyHanniTestCommand { list.add("$coloredName§7 (") for (itemName in item.value) { try { - val internalName = NEUItems.getInternalName(itemName) + val internalName = NEUItems.getRawInternalName(itemName) list.add(NEUItems.getItemStack(internalName)) } catch (e: Error) { LorenzUtils.debug("itemName '$itemName' is invalid for visitor '$name'") @@ -222,7 +222,7 @@ class SkyHanniTestCommand { if (!SkyHanniMod.feature.dev.showInternalName) return val itemStack = event.itemStack if (itemStack != null) { - val internalName = itemStack.getInternalName() + val internalName = itemStack.getInternalName_old() if (internalName == "" && !SkyHanniMod.feature.dev.showEmptyNames) return event.toolTip.add("Internal Name: '$internalName'") } diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt index 23b5d45ae..b243c9991 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber @@ -23,10 +23,10 @@ object TestCopyRngMeterValues { for (item in event.inventoryItems.values) { for (line in item.getLore()) { slayerPattern.matchMatcher(line) { - map[item.getInternalName()] = group("xp").formatNumber() + map[item.getInternalName_old()] = group("xp").formatNumber() } dungeonPattern.matchMatcher(line) { - map[item.getInternalName()] = group("xp").formatNumber() + map[item.getInternalName_old()] = group("xp").formatNumber() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt index 10865a213..2b33c8e82 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.test.command import at.hannibal2.skyhanni.test.SkyHanniTestCommand -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils @@ -15,7 +15,7 @@ object CopyItemCommand { val itemStack = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem()!! resultList.add("ITEM LORE") resultList.add("display name: '" + itemStack.displayName.toString() + "'") - val itemID = itemStack.getInternalName() + val itemID = itemStack.getInternalName_old() resultList.add("internalName: '$itemID'") resultList.add("") for (line in itemStack.getLore()) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 53e810483..314275fa8 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -117,13 +117,14 @@ object ItemUtils { return false } - fun ItemStack.getInternalNameOrNull() = getInternalName().takeIf { it != "" } + // TODO remove + fun ItemStack.getInternalName_old() = getInternalName().asString() - fun ItemStack.getInternalNameOrNull_new() = getInternalName_new().takeIf { it.asString() != "" } + fun ItemStack.getInternalName() = getInternalNameOrNull() ?: "".asInternalName() - fun ItemStack.getInternalName_new() = getInternalName().asInternalName() + fun ItemStack.getInternalNameOrNull() = getRawInternalName()?.asInternalName() - fun ItemStack.getInternalName(): String { + private fun ItemStack.getRawInternalName(): String? { if (name == "§fWisp's Ice-Flavored Water I Splash Potion") { return "WISP_POTION" } @@ -186,7 +187,7 @@ object ItemUtils { return name } - fun isSkyBlockMenuItem(stack: ItemStack?): Boolean = stack?.getInternalName() == "SKYBLOCK_MENU" + fun isSkyBlockMenuItem(stack: ItemStack?): Boolean = stack?.getInternalName_old() == "SKYBLOCK_MENU" private val patternInFront = "(?: *§8(?<amount>[\\d,]+)x )?(?<name>.*)".toPattern() private val patternBehind = "(?<name>(?:['\\w-]+ ?)+)(?:§8x(?<amount>[\\d,]+))?".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt index 89741cbef..5ccb74664 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt @@ -24,5 +24,14 @@ class NEUInternalName private constructor(private val internalName: String) { override fun hashCode(): Int = internalName.hashCode() -// fun equals(other: String) = internalName == other + fun equals(other: String) = internalName == other + + fun contains(other: String) = internalName.contains(other) + + fun startsWith(other: String) = internalName.startsWith(other) + + fun endsWith(other: String) = internalName.endsWith(other) + + fun replace(oldValue: String, newValue: String) = + internalName.replace(oldValue.uppercase(), newValue.uppercase()).asInternalName() }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index ad424d5d2..0e831e486 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.ItemBlink.checkBlinkItem -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -45,12 +45,13 @@ object NEUItems { ) } - fun getInternalName(itemName: String): String { - return getInternalNameOrNull_new(itemName)?.asString() ?: throw Error("getInternalName is null for '$itemName'") + // TODO remove + fun getRawInternalName(itemName: String): String { + return getInternalNameOrNull(itemName)?.asString() ?: throw Error("internal name is null for '$itemName'") } - fun getInternalName_new(itemName: String): NEUInternalName { - return getInternalNameOrNull_new(itemName) ?: throw Error("getInternalName is null for '$itemName'") + fun getInternalName(itemName: String): NEUInternalName { + return getInternalNameOrNull(itemName) ?: throw Error("getInternalName is null for '$itemName'") } fun getInternalNameOrNullIgnoreCase(itemName: String): NEUInternalName? { @@ -82,9 +83,10 @@ object NEUItems { return map } - fun getInternalNameOrNull(itemName: String) = getInternalNameOrNull_new(itemName)?.asString() + // TODO remove + fun getRawInternalNameOrNull(itemName: String) = getInternalNameOrNull(itemName)?.asString() - fun getInternalNameOrNull_new(itemName: String): NEUInternalName? { + fun getInternalNameOrNull(itemName: String): NEUInternalName? { val lowercase = itemName.lowercase() if (itemNameCache.containsKey(lowercase)) { return itemNameCache[lowercase]!! @@ -132,7 +134,7 @@ object NEUItems { fun getInternalName(itemStack: ItemStack) = ItemResolutionQuery(manager) .withCurrentGuiContext() .withItemStack(itemStack) - .resolveInternalName() ?: "" + .resolveInternalName() fun getInternalNameOrNull(nbt: NBTTagCompound) = ItemResolutionQuery(manager).withItemNBT(nbt).resolveInternalName() @@ -145,9 +147,6 @@ object NEUItems { return price } - fun getPriceOrNull(internalName: String, useSellingPrice: Boolean = false) = - internalName.asInternalName().getPriceOrNull(useSellingPrice) - fun transHypixelNameToInternalName(hypixelId: String) = manager.auctionManager.transformHypixelBazaarToNEUItemId(hypixelId).asInternalName() @@ -197,7 +196,7 @@ object NEUItems { fallbackItem } - fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName()) + fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName_old()) fun ItemStack.renderOnScreen(x: Float, y: Float, scaleMultiplier: Double = 1.0) { val item = checkBlinkItem() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index b63bdcef3..77d291d84 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.mixins.hooks.ItemStackCachedData -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName @@ -28,7 +28,7 @@ object SkyBlockItemModifierUtils { it - 5 - getBaseSilexCount() }?.takeIf { it > 0 } - private fun ItemStack.getBaseSilexCount() = when (getInternalName()) { + private fun ItemStack.getBaseSilexCount() = when (getInternalName_old()) { "STONK_PICKAXE" -> 1 "PROMISING_SPADE" -> 5 |