From 4a76d31e9c1bef01b2d6617777f808ea03f117c2 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 6 Apr 2024 10:20:15 +1100 Subject: Backend: Add isEnabled to BasketWaypoints (#1207) --- .../event/lobby/waypoints/halloween/BasketWaypoints.kt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt index 1eae1e8a6..da267da07 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt @@ -25,8 +25,7 @@ class BasketWaypoints { if (!config.allWaypoints && !config.allEntranceWaypoints) return if (!isHalloween) return - if (!HypixelData.hypixelLive) return // don't show outside live hypixel network (it's disabled on alpha) - if (LorenzUtils.inSkyBlock) return + if (!isEnabled()) return val message = event.message if (message.startsWith("§a§lYou found a Candy Basket! §r") || message == "§cYou already found this Candy Basket!") { @@ -41,8 +40,7 @@ class BasketWaypoints { @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!config.allWaypoints && !config.allEntranceWaypoints) return - if (!HypixelData.hypixelLive) return // don't show outside live hypixel network (it's disabled on alpha) - if (LorenzUtils.inSkyBlock) return + if (!isEnabled()) return if (event.repeatSeconds(1)) { isHalloween = checkScoreboardHalloweenSpecific() @@ -61,8 +59,7 @@ class BasketWaypoints { @SubscribeEvent fun onRenderWorld(event: LorenzRenderWorldEvent) { - if (!HypixelData.hypixelLive) return // don't show outside live hypixel network (it's disabled on alpha) - if (LorenzUtils.inSkyBlock) return + if (!isEnabled()) return if (!isHalloween) return if (config.allWaypoints) { @@ -81,8 +78,6 @@ class BasketWaypoints { } return } - - if (LorenzUtils.skyBlockArea == "?") return } private fun Basket.shouldShow(): Boolean { @@ -101,6 +96,8 @@ class BasketWaypoints { return a && b && c } + private fun isEnabled() = HypixelData.hypixelLive && !LorenzUtils.inSkyBlock + @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(13, "event.halloweenBasket", "event.lobbyWaypoints.halloweenBasket") -- cgit