diff options
author | Walker Selby <git@walkerselby.com> | 2023-12-16 11:22:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-16 12:22:48 +0100 |
commit | f35378de786004fe0972e989620ae89f1258feef (patch) | |
tree | a85e2615c164558eb6b32bd25513e41a27d1b6ce | |
parent | bfd29908273cc714e9dd8cb8e2d8d164b3c9400e (diff) | |
download | skyhanni-f35378de786004fe0972e989620ae89f1258feef.tar.gz skyhanni-f35378de786004fe0972e989620ae89f1258feef.tar.bz2 skyhanni-f35378de786004fe0972e989620ae89f1258feef.zip |
Add Racing Helmet check + helper functions for armor (#801)
Add Racing Helmet check + helper functions for armor #801
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt | 6 |
2 files changed, 9 insertions, 1 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 7e5740d4a..5ebc4e8d4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -25,8 +25,10 @@ import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.garden.pests.PestAPI import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.InventoryUtils.getHelmet 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.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -165,7 +167,7 @@ object ItemDisplayOverlayFeatures { if (RANCHERS_BOOTS_SPEED.isSelected() && itemName.contains("Rancher's Boots")) { item.getRanchersSpeed()?.let { - return if (it > 400 && PetAPI.currentPet?.contains("Black Cat") == false) { + return if (it > 400 && (PetAPI.currentPet?.contains("Black Cat") == true || getHelmet()?.getInternalName() == "RACING_HELMET".asInternalName())) { "§c$it" } else { "§a$it" diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt index 6e8ddda53..827b87854 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt @@ -49,6 +49,12 @@ object InventoryUtils { fun getArmor(): Array<ItemStack?> = Minecraft.getMinecraft().thePlayer.inventory.armorInventory + fun getHelmet(): ItemStack? = getArmor()[3] + fun getChestplate(): ItemStack? = getArmor()[2] + fun getLeggings(): ItemStack? = getArmor()[1] + fun getBoots(): ItemStack? = getArmor()[0] + + val isNeuStorageEnabled = RecalculatingValue(10.seconds) { try { val config = NotEnoughUpdates.INSTANCE.config |