diff options
author | Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> | 2023-10-12 09:35:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-12 15:35:08 +0200 |
commit | 78093386e000704e7aba3163467456d79b728629 (patch) | |
tree | 49f4fe0da7badff0825db0ce2c5f35a6ab5c74d3 /src/main/java/at/hannibal2/skyhanni/features/misc | |
parent | 49eff144941a98c1583934ab61eac3c79b9979f7 (diff) | |
download | skyhanni-78093386e000704e7aba3163467456d79b728629.tar.gz skyhanni-78093386e000704e7aba3163467456d79b728629.tar.bz2 skyhanni-78093386e000704e7aba3163467456d79b728629.zip |
Feature: Lobby halloween waypoints, per request of Tobbbb (#540)
Show waypoints for Baskets of the Halloween Event in the main lobby. #540
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
3 files changed, 120 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/Basket.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/Basket.kt new file mode 100644 index 000000000..45d1a4162 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/Basket.kt @@ -0,0 +1,34 @@ +package at.hannibal2.skyhanni.features.misc.halloweenlobbywaypoints + +import at.hannibal2.skyhanni.utils.LorenzVec + +enum class Basket( + val basketName: String, + val waypoint: LorenzVec +) { + BASKET_1("#1", LorenzVec(-31, 91, -19)), + BASKET_2("#2", LorenzVec(-14, 85, -78)), + BASKET_3("#3", LorenzVec(24, 68, -29)), + BASKET_4("#4", LorenzVec(57, 64, -90)), + BASKET_5("#5", LorenzVec(129, 70, -130)), + BASKET_6("#6", LorenzVec(-5, 62, -181)), + BASKET_7("#7", LorenzVec(-145, 74, -137)), + BASKET_8("#8", LorenzVec(-7, 65, 130)), + BASKET_9("#9", LorenzVec(-7, 57, 196)), + BASKET_10("#10", LorenzVec(-75, 61, 195)), + BASKET_11("#11", LorenzVec(-131, 61, 152)), + BASKET_12("#12", LorenzVec(-107, 24, 27)), + BASKET_13("#13", LorenzVec(-6, 63, 23)), + BASKET_14("#14", LorenzVec(29, 71, 24)), + BASKET_15("#15", LorenzVec(136, 64, -10)), + BASKET_16("#16", LorenzVec(199, 85, -41)), + BASKET_17("#17", LorenzVec(199, 58, -41)), + BASKET_18("#18", LorenzVec(112, 45, -15)), + BASKET_19("#19", LorenzVec(111, 65, 31)), + BASKET_20("#20", LorenzVec(138, 62, 94)), + BASKET_21("#21", LorenzVec(109, 67, 149)), + BASKET_22("#22", LorenzVec(94, 53, 238)), + BASKET_23("#23", LorenzVec(-84, 72, 8)), + BASKET_24("#24", LorenzVec(-13, 31, -26)), + BASKET_25("#25 (get your code first!)", LorenzVec(-32, 14, 102)), +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/BasketEntrances.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/BasketEntrances.kt new file mode 100644 index 000000000..07110d528 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/BasketEntrances.kt @@ -0,0 +1,16 @@ +package at.hannibal2.skyhanni.features.misc.halloweenlobbywaypoints + +import at.hannibal2.skyhanni.utils.LorenzVec + +enum class BasketEntrances( + val basketEntranceName: String, + val waypoint: LorenzVec +) { + BASKET_ENTER_23("#23, #24 (behind the lava)", LorenzVec(-138, 74, -4)), + BASKET_ENTER_24("#24 (within this tunnel)", LorenzVec(-80, 72, -4)), + BASKET_ENTER_25_1("#25 (1st digit, SNEAK + RCLICK)", LorenzVec(143, 65, -30)), + BASKET_ENTER_25_2("#25 (3rd digit, open chest)", LorenzVec(205, 34, -157)), + BASKET_ENTER_25_3("#25 (inside this well)", LorenzVec(10, 63, 0)), + BASKET_ENTER_25_4("#25 (left turn [<--] here)", LorenzVec(-28, 41, 14)), + BASKET_ENTER_25_5("#25 Vault (brute force 2nd digit)", LorenzVec(-35, 25, 63)), +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/BasketWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/BasketWaypoints.kt new file mode 100644 index 000000000..c6ba348d2 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/halloweenlobbywaypoints/BasketWaypoints.kt @@ -0,0 +1,70 @@ +package at.hannibal2.skyhanni.features.misc.halloweenlobbywaypoints + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.HypixelData +import at.hannibal2.skyhanni.data.ScoreboardData +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText +import net.minecraft.client.Minecraft +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BasketWaypoints { + private val config get() = SkyHanniMod.feature.misc.halloweenBasket + private var waypoint: LorenzVec? = null + private var waypointName: String? = null + private var isHalloween: Boolean = false + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!config.allWaypoints && !config.allEntranceWaypoints) return + if (!HypixelData.hypixelLive) return //dont show outside of live hypixel network + if (LorenzUtils.inSkyBlock) return + if (!event.repeatSeconds(1)) return + isHalloween = chechScoreboardHalloweenSpecific() + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!isHalloween) return + + if (config.allWaypoints) { + for (basket in Basket.entries) { + event.drawWaypointFilled(basket.waypoint, LorenzColor.GOLD.toColor()) + event.drawDynamicText(basket.waypoint, "§6" + basket.basketName, 1.5) + } + } + + if (config.allEntranceWaypoints) { + for (basketEntrance in BasketEntrances.entries) { + event.drawWaypointFilled(basketEntrance.waypoint, LorenzColor.YELLOW.toColor()) + event.drawDynamicText(basketEntrance.waypoint, "§e" + basketEntrance.basketEntranceName, 1.5) + } + return + } + + if (LorenzUtils.skyBlockArea == "?") return + + waypoint?.let { + event.drawWaypointFilled(it, LorenzColor.GOLD.toColor()) + event.drawDynamicText(it, "§6" + waypointName!!, 1.5) + } + } + + private fun chechScoreboardHalloweenSpecific(): Boolean { + //am checking separate lines of scoreboard, cannot do `it.contains("xyz") && it.contains("ABC")` + val theScoreboardList = ScoreboardData.sidebarLinesFormatted + return ( theScoreboardList.any { + it.contains("Hypixel Level") + } && theScoreboardList.any { + it.contains("Halloween") + } && theScoreboardList.any { + it.contains("Baskets") + } + ) + } +}
\ No newline at end of file |