Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend: Add isEnabled to BasketWaypoints #1207

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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!") {
Expand All @@ -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()
Expand All @@ -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) {
Expand All @@ -81,8 +78,6 @@ class BasketWaypoints {
}
return
}

if (LorenzUtils.skyBlockArea == "?") return
}

private fun Basket.shouldShow(): Boolean {
Expand All @@ -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")
Expand Down
Loading