aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-12-13 16:04:59 -0800
committerGitHub <noreply@github.com>2023-12-14 01:04:59 +0100
commit62e6776252ef991bd1387d7b9d1c4a417f4bbb2f (patch)
tree07264153897b192c909d72b58a5be9b052a55b94 /src
parentb7e4d63c3ec4331b2332b7b02c2ecef3f19487b5 (diff)
downloadskyhanni-62e6776252ef991bd1387d7b9d1c4a417f4bbb2f.tar.gz
skyhanni-62e6776252ef991bd1387d7b9d1c4a417f4bbb2f.tar.bz2
skyhanni-62e6776252ef991bd1387d7b9d1c4a417f4bbb2f.zip
Fix: Modify ItemStack ranchers boot check to use NBT (#795)
Fixed rancher boots speed stack size. #795
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt2
2 files changed, 9 insertions, 4 deletions
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 6df462af1..e3ba427f7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
@@ -20,6 +20,7 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.RANCHERS_BOOTS_SPEED
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKILL_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.VACUUM_GARDEN
+import at.hannibal2.skyhanni.data.PetAPI
import at.hannibal2.skyhanni.events.RenderItemTipEvent
import at.hannibal2.skyhanni.features.garden.pests.PestAPI
import at.hannibal2.skyhanni.utils.ConfigUtils
@@ -37,6 +38,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getBottleOfJyrreSeconds
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEdition
+import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRanchersSpeed
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraft.item.ItemStack
@@ -47,7 +49,6 @@ object ItemDisplayOverlayFeatures {
private val config get() = SkyHanniMod.feature.inventory
// TODO repo
- private val rancherBootsSpeedCapPattern = "§7Current Speed Cap: §a(?<cap>.*)".toPattern()
private val petLevelPattern = "\\[Lvl (?<level>.*)] .*".toPattern()
private val masterSkullPattern = "(.*)Master Skull - Tier .".toPattern()
private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?<amount>\\d*) Pests?".toPattern()
@@ -163,10 +164,12 @@ object ItemDisplayOverlayFeatures {
}
if (RANCHERS_BOOTS_SPEED.isSelected() && itemName.contains("Rancher's Boots")) {
- for (line in item.getLore()) {
- rancherBootsSpeedCapPattern.matchMatcher(line) {
- return group("cap")
+ val ranchersSpeed = item.getRanchersSpeed()
+ if (ranchersSpeed != null) {
+ if (ranchersSpeed > 400 && PetAPI.currentPet?.contains("Black Cat") == false) {
+ return "§c" + ranchersSpeed.toString()
}
+ return "§a" + ranchersSpeed.toString()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index 9db592047..82a6b076f 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -121,6 +121,8 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getFungiCutterMode() = getAttributeString("fungi_cutter_mode")
+ fun ItemStack.getRanchersSpeed() = getAttributeInt("ranchers_speed")
+
fun ItemStack.getRune(): NEUInternalName? {
val runesMap = getExtraAttributes()?.getCompoundTag("runes") ?: return null
val runesList = runesMap.keySet.associateWith { runesMap.getInteger(it) }.toList()