From ed3fca1da9c642ac6bacc2c2254f36d982bd25b2 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 16 Dec 2023 12:27:42 +0100 Subject: Created PetAPI.isCurrentPet. --- src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt | 2 ++ src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt | 2 +- src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt | 2 +- .../hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt index 9c5eac610..d8061683b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt @@ -8,4 +8,6 @@ object PetAPI { set(value) { ProfileStorageData.profileSpecific?.currentPet = value } + + fun isCurrentPet(petName: String): Boolean = currentPet?.contains(petName) ?: false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt index 081136f00..7a6fa1d17 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt @@ -19,7 +19,7 @@ object DianaAPI { private fun isRitualActive() = MayorElection.isPerkActive("Diana", "Mythological Ritual") || MayorElection.isPerkActive("Jerry", "Perkpocalypse") || SkyHanniMod.feature.event.diana.alwaysDiana - fun hasGriffinPet() = PetAPI.currentPet?.contains("Griffin") ?: false + fun hasGriffinPet() = PetAPI.isCurrentPet("Griffin") fun isDoingDiana() = IslandType.HUB.isInIsland() && isRitualActive() && hasSpadeInInventory() 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 7fba5b56a..78ca8f2b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -45,7 +45,7 @@ object GardenAPI { var toolInHand: String? = null var itemInHand: ItemStack? = null var cropInHand: CropType? = null - val mushroomCowPet get() = PetAPI.currentPet?.contains("Mooshroom Cow") ?: false + val mushroomCowPet get() = PetAPI.isCurrentPet("Mooshroom Cow") private var inBarn = false val onBarnPlot get() = inBarn && inGarden() val storage get() = ProfileStorageData.profileSpecific?.garden 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 df6949a7e..a4e28961e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -166,7 +166,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") == true || + return if (it > 400 && (PetAPI.isCurrentPet("Black Cat") || InventoryUtils.getHelmet()?.getInternalName() == "RACING_HELMET".asInternalName()) ) { "§c$it" -- cgit