diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-06-13 19:39:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 19:39:40 +0200 |
commit | 38ad085118f6d0403c8d59345a250dd182191a20 (patch) | |
tree | 7fec1db1b9f5ae5f2f0416ac6cce84be2adf45b0 /src/main/java/at/hannibal2 | |
parent | 1f4edc62accbb3af633c5341d973cb1f053385f2 (diff) | |
download | skyhanni-38ad085118f6d0403c8d59345a250dd182191a20.tar.gz skyhanni-38ad085118f6d0403c8d59345a250dd182191a20.tar.bz2 skyhanni-38ad085118f6d0403c8d59345a250dd182191a20.zip |
Feature: Added Rabbit pet warning (#2087)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2')
3 files changed, 42 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java index 816471e16..96911d97d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java @@ -141,4 +141,14 @@ public class HoppityEggsConfig { @ConfigEditorBoolean @FeatureToggle public boolean compactChat = false; + + @Expose + @ConfigOption( + name = "Rabbit Pet Warning", + desc = "Warn when using the Egglocator without having a §d§lMythic Rabbit Pet §7selected. " + + "§eOnly enable this setting when you own a mythic Rabbit pet." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean petWarning = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt index a5ab1a7c6..4e5d96f2a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt @@ -215,6 +215,7 @@ object HoppityEggLocator { if (event.clickType == ClickType.RIGHT_CLICK && item.isLocatorItem) { lastClick = SimpleTimeMark.now() + MythicRabbitPetWarning.check() } } @@ -238,7 +239,7 @@ object HoppityEggLocator { secondPos = LorenzVec( secondPoint.x + xDiff * 1000, secondPoint.y + yDiff * 1000, - secondPoint.z + zDiff * 1000 + secondPoint.z + zDiff * 1000, ) val sortedEggs = islandEggsLocations.map { @@ -277,8 +278,8 @@ object HoppityEggLocator { private fun ReceiveParticleEvent.isEnchantmentParticle() = type == EnumParticleTypes.ENCHANTMENT_TABLE && speed == -2.0f && count == 10 - fun isEnabled() = LorenzUtils.inSkyBlock && config.waypoints && !GardenAPI.inGarden() - && !ReminderUtils.isBusy(true) && ChocolateFactoryAPI.isHoppityEvent() + fun isEnabled() = LorenzUtils.inSkyBlock && config.waypoints && !GardenAPI.inGarden() && + !ReminderUtils.isBusy(true) && ChocolateFactoryAPI.isHoppityEvent() private val ItemStack.isLocatorItem get() = getInternalName() == locatorItem 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 new file mode 100644 index 000000000..59e951d21 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/MythicRabbitPetWarning.kt @@ -0,0 +1,28 @@ +package at.hannibal2.skyhanni.features.event.hoppity + +import at.hannibal2.skyhanni.data.PetAPI +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.SimpleTimeMark +import kotlin.time.Duration.Companion.seconds + +object MythicRabbitPetWarning { + val mythicRabbit = "§dRabbit" + var lastCheck = SimpleTimeMark.farPast() + + fun check() { + if (!HoppityEggsManager.config.petWarning) return + + if (lastCheck.passedSince() < 30.seconds) return + + if (!PetAPI.isCurrentPet(mythicRabbit)) { + lastCheck = SimpleTimeMark.now() + warn() + } + } + + private fun warn() { + ChatUtils.chat("Use a mythic Rabbit pet for more chocolate!") + LorenzUtils.sendTitle("§cNo Rabbit Pet!", 3.seconds) + } +} |