aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 13:50:53 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 13:50:53 +0200
commitd19350d4b0b99f6b04680aba9686ddbe1e7df780 (patch)
treeabb8859f13f2f03ebf9457624f8f2cbae6496b00 /src/main/java/at/hannibal2/skyhanni/features/garden
parente04efa84f7d42ddcbe11eb65f25adc0e524a3aaa (diff)
downloadskyhanni-d19350d4b0b99f6b04680aba9686ddbe1e7df780.tar.gz
skyhanni-d19350d4b0b99f6b04680aba9686ddbe1e7df780.tar.bz2
skyhanni-d19350d4b0b99f6b04680aba9686ddbe1e7df780.zip
Changing internalName to getInternalName_old, and getInternalName_new to internalName
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt27
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt13
16 files changed, 65 insertions, 53 deletions
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
}