diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-02-19 13:29:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 13:29:45 +0100 |
commit | 7d9a6a101071c75773668e0881b37466506307dd (patch) | |
tree | 0f46abdd4375d2eeb1a5c8154a2cb72046fb7621 /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | 4bb1419b90e424ac824042188f67a371a5c276da (diff) | |
download | skyhanni-7d9a6a101071c75773668e0881b37466506307dd.tar.gz skyhanni-7d9a6a101071c75773668e0881b37466506307dd.tar.bz2 skyhanni-7d9a6a101071c75773668e0881b37466506307dd.zip |
Item name rewrite and cache #1016
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
5 files changed, 15 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt index 42d417a5a..217b01259 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.features.garden.farming.CropMoneyDisplay import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.sorted -import at.hannibal2.skyhanni.utils.ItemUtils.getItemName +import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber @@ -45,10 +45,10 @@ object GardenCropTimeCommand { val map = mutableMapOf<String, Long>() for (entry in multipliers) { val internalName = entry.key - val itemName = internalName.getItemName() + val itemName = internalName.itemName if (itemName.removeColor().lowercase().contains(searchName)) { val (baseId, baseAmount) = NEUItems.getMultiplier(internalName) - val baseName = baseId.getItemName() + val baseName = baseId.itemName val crop = CropType.getByName(baseName.removeColor()) val fullAmount = baseAmount.toLong() * amount diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropsInCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropsInCommand.kt index 4bf34a5ae..8523a7a58 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropsInCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropsInCommand.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.features.garden.farming.CropMoneyDisplay import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.sorted -import at.hannibal2.skyhanni.utils.ItemUtils.getItemName +import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -44,10 +44,10 @@ object GardenCropsInCommand { val map = mutableMapOf<String, Long>() for (entry in multipliers) { val internalName = entry.key - val itemName = internalName.getItemName() + val itemName = internalName.itemName if (itemName.removeColor().lowercase().contains(searchName)) { val (baseId, baseAmount) = NEUItems.getMultiplier(internalName) - val baseName = baseId.getItemName() + val baseName = baseId.itemName val crop = CropType.getByName(baseName.removeColor()) val speed = crop.getSpeed() 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 c592b7837..771c1df2a 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 @@ -24,7 +24,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getItemNameOrNull +import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName @@ -37,7 +37,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName -import at.hannibal2.skyhanni.utils.StringUtils.removeColor import kotlinx.coroutines.launch import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -209,7 +208,7 @@ object CropMoneyDisplay { } if (!config.compact) { - val itemName = internalName.getItemNameOrNull()?.removeColor() ?: continue + val itemName = internalName.itemNameWithoutColor val currentColor = if (isCurrent) "§e" else "§7" val contestFormat = if (GardenNextJacobContest.isNextCrop(crop)) "§n" else "" list.add("$currentColor$contestFormat$itemName§7: ") @@ -408,7 +407,7 @@ object CropMoneyDisplay { if (!internalName.isBazaarItem()) continue val (newId, amount) = NEUItems.getMultiplier(internalName) - val itemName = newId.getItemNameOrNull()?.removeColor() ?: continue + val itemName = newId.itemNameWithoutColor val crop = getByNameOrNull(itemName) crop?.let { map[internalName] = amount 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 f137651a0..2d33fd9b1 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 @@ -12,8 +12,8 @@ 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.getItemName import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrCommon +import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil.addSuffix import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments @@ -84,7 +84,7 @@ object FortuneUpgrades { val nextTalisman = CropAccessory.entries[currentTalismanTier + 1] genericUpgrades.add( FortuneUpgrade( - "§7Upgrade your talisman to ${nextTalisman.internalName?.getItemName()}", + "§7Upgrade your talisman to ${nextTalisman.internalName?.itemName}", null, nextTalisman.upgradeCost?.first!!, nextTalisman.upgradeCost.second, 10.0 ) ) 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 d32b8e75d..4b659e9bf 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 @@ -33,9 +33,9 @@ import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemBlink import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getItemName -import at.hannibal2.skyhanni.utils.ItemUtils.getItemNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.itemName +import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.LorenzUtils @@ -179,7 +179,7 @@ class GardenVisitorFeatures { var totalPrice = 0.0 addAsSingletonList("§7Visitor Shopping List:") for ((internalName, amount) in shoppingList) { - val name = internalName.getItemName() + val name = internalName.itemName val itemStack = internalName.getItemStack() val list = mutableListOf<Any>() @@ -410,7 +410,7 @@ class GardenVisitorFeatures { if (!readingShoppingList) continue val multiplier = NEUItems.getMultiplier(internalName) - val rawName = multiplier.first.getItemNameOrNull()?.removeColor() ?: continue + val rawName = multiplier.first.itemNameWithoutColor val cropType = getByNameOrNull(rawName) ?: continue val cropAmount = multiplier.second.toLong() * amount |