aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-16 12:27:42 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-16 12:27:42 +0100
commited3fca1da9c642ac6bacc2c2254f36d982bd25b2 (patch)
tree2aff37e82169dd9efafb4c68b641c8506c134a60
parent6146bb97e771ab8061b988d184e4c70f48ab6130 (diff)
downloadskyhanni-ed3fca1da9c642ac6bacc2c2254f36d982bd25b2.tar.gz
skyhanni-ed3fca1da9c642ac6bacc2c2254f36d982bd25b2.tar.bz2
skyhanni-ed3fca1da9c642ac6bacc2c2254f36d982bd25b2.zip
Created PetAPI.isCurrentPet.
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt2
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"