From 8988f7d34d706b909012dceea8bad65b4863ea44 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sun, 29 Sep 2024 19:41:58 +1000 Subject: Backend: Detekt Fixes Part 4 (#2610) --- .../skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt | 6 +++--- .../skyhanni/features/event/hoppity/MythicRabbitPetWarning.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/event') diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt index e24a66594..b1939a793 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt @@ -57,12 +57,12 @@ object UniqueGiftingOpportunitiesFeatures { private fun isEnabled() = holdingGift - private val hasNotGiftedNametag = "§a§lꤥ" - private val hasGiftedNametag = "§c§lꤥ" + private const val HAS_NOT_GIFTED_NAMETAG = "§a§lꤥ" + private const val HAS_GIFTED_NAMETAG = "§c§lꤥ" private fun analyzeArmorStand(entity: EntityArmorStand) { if (!config.useArmorStandDetection) return - if (entity.name != hasGiftedNametag) return + if (entity.name != HAS_GIFTED_NAMETAG) return val matchedPlayer = EntityUtils.getEntitiesNearby(entity.getLorenzVec(), 2.0) .singleOrNull { !it.isNPC() } ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/MythicRabbitPetWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/MythicRabbitPetWarning.kt index 8162f3a05..833583ad0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/MythicRabbitPetWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/MythicRabbitPetWarning.kt @@ -7,8 +7,8 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark import kotlin.time.Duration.Companion.seconds object MythicRabbitPetWarning { - val mythicRabbit = "§dRabbit" - var lastCheck = SimpleTimeMark.farPast() + private const val MYTHIC_RABBIT_DISPLAY_NAME = "§dRabbit" + private var lastCheck = SimpleTimeMark.farPast() fun check() { if (!HoppityEggsManager.config.petWarning) return @@ -21,7 +21,7 @@ object MythicRabbitPetWarning { } } - fun correctPet() = PetAPI.isCurrentPet(mythicRabbit) + fun correctPet() = PetAPI.isCurrentPet(MYTHIC_RABBIT_DISPLAY_NAME) private fun warn() { ChatUtils.chat("Use a §dMythic Rabbit Pet §efor more chocolate!") -- cgit