diff options
author | Walker Selby <git@walkerselby.com> | 2023-10-21 07:24:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-21 08:24:27 +0200 |
commit | c5745ed4ee07759261da1dc9c0f654617276f163 (patch) | |
tree | b5d5305611c8c67a365aa3ecfc8c88b1c26fbdbb /src/main | |
parent | 92e3c377e481a8a0bd30d35133153fb5ea3b24aa (diff) | |
download | skyhanni-c5745ed4ee07759261da1dc9c0f654617276f163.tar.gz skyhanni-c5745ed4ee07759261da1dc9c0f654617276f163.tar.bz2 skyhanni-c5745ed4ee07759261da1dc9c0f654617276f163.zip |
Internal Changes: getInternalName Pt 3 (#549)
Internal Changes: getInternalName Pt 3 #549
Diffstat (limited to 'src/main')
4 files changed, 11 insertions, 16 deletions
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 cf629bcb5..0ae437db7 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 @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems @@ -18,7 +18,7 @@ class TrophyFishFillet { fun onTooltip(event: LorenzToolTipEvent) { if (!isEnabled()) return if (event.slot.inventory.name.contains("Sack")) return - val internalName = event.itemStack.getInternalName_old() + val internalName = event.itemStack.getInternalName().asString() val trophyFishName = internalName.substringBeforeLast("_") .replace("_", "").lowercase() val trophyRarityName = internalName.substringAfterLast("_") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 64ef4e9df..3cd2e0a39 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.composter.ComposterAPI.getLevel 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.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils @@ -450,7 +451,7 @@ class ComposterOverlay { BazaarApi.searchForBazaarItem(itemName, itemsNeeded) return } - val having = InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName.asInternalName() } + val having = InventoryUtils.countItemsInLowerInventory { it.getInternalName_old() == internalName } if (having >= itemsNeeded) { LorenzUtils.chat("§e[SkyHanni] $itemName §8x${itemsNeeded} §ealready found in inventory!") return 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 1718adf7d..1f35e0647 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 @@ -11,7 +11,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_old +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -100,7 +100,7 @@ class FarmingArmorDrops { private fun checkArmor() { val armorPieces = InventoryUtils.getArmor() - .mapNotNull { it?.getInternalName_old() } + .mapNotNull { it?.getInternalName()?.asString() } .count { armorPattern.matcher(it).matches() } hasArmor = armorPieces > 1 } @@ -130,7 +130,7 @@ class FarmingArmorDrops { val armorDropName = crop.specialDropType val armorName = armorDropInfo[armorDropName]?.armor_type ?: return 0.0 val pieceCount = InventoryUtils.getArmor() - .mapNotNull { it?.getInternalName_old() } + .mapNotNull { it?.getInternalName()?.asString() } .count { it.contains(armorName) || it.contains("FERMENTO") } val dropRates = armorDropInfo[armorDropName]?.chance ?: return 0.0 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 00e5653dd..f0ad1baff 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,8 +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 -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils @@ -42,12 +41,7 @@ class CaptureFarmingGear { fun captureFarmingGear() { val farmingItems = farmingItems ?: return - val resultList = mutableListOf<String>() - val itemStack = InventoryUtils.getItemInHand() ?: return - val itemID = itemStack.getInternalName_old() - resultList.add(itemStack.displayName.toString()) - resultList.add(itemID) val currentCrop = itemStack.getCropType() @@ -63,7 +57,7 @@ class CaptureFarmingGear { } for (armor in InventoryUtils.getArmor()) { if (armor == null) continue - val split = armor.getInternalName_old().split("_") + val split = armor.getInternalName().asString().split("_") if (split.first() in farmingSets) { for (item in FarmingItems.entries) { if (item.name == split.last()) { @@ -99,7 +93,7 @@ class CaptureFarmingGear { val outdatedItems = outdatedItems ?: return if (event.inventoryName == "Your Equipment and Stats") { for ((_, slot) in event.inventoryItems) { - val split = slot.getInternalName_old().split("_") + val split = slot.getInternalName().asString().split("_") if (split.first() == "LOTUS") { for (item in FarmingItems.entries) { if (item.name == split.last()) { @@ -136,7 +130,7 @@ class CaptureFarmingGear { var highestBeeRarity = (farmingItems[FarmingItems.BEE]?.getItemRarityOrNull()?.id ?: -1) - 1 for ((_, item) in event.inventoryItems) { - val split = item.getInternalName_old().split(";") + val split = item.getInternalName().asString().split(";") if (split.first() == "ELEPHANT" && split.last().toInt() > highestElephantRarity) { farmingItems[FarmingItems.ELEPHANT] = item outdatedItems[FarmingItems.ELEPHANT] = false |