aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-07 11:06:16 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-07 11:06:16 +0200
commitaf192ed7327735f5ac590f65d30a001d68815e06 (patch)
treef8ae518ee552d86c634eccb3d28f31c9ee01b4c7 /src/main/java/at/hannibal2/skyhanni/features/mining
parentab0e2df6feae63caec66143a5328ad1c95adff82 (diff)
downloadskyhanni-af192ed7327735f5ac590f65d30a001d68815e06.tar.gz
skyhanni-af192ed7327735f5ac590f65d30a001d68815e06.tar.bz2
skyhanni-af192ed7327735f5ac590f65d30a001d68815e06.zip
Show the names of the 4 areas while in the center of crystal hollows.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt
new file mode 100644
index 000000000..b8367b3d0
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt
@@ -0,0 +1,47 @@
+package at.hannibal2.skyhanni.features.mining.crystalhollows
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayerIgnoreYSq
+import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
+import at.hannibal2.skyhanni.utils.LorenzVec
+import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
+import net.minecraftforge.client.event.RenderWorldLastEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class CrystalHollowsNamesInCore {
+ val config get() = SkyHanniMod.feature.misc.mining
+ val coreLocations = mapOf(
+ LorenzVec(550, 116, 550) to "§8Precursor City",
+ LorenzVec(552, 116, 474) to "§bMithril Deposits",
+ LorenzVec(477, 116, 476) to "§aJungle",
+ LorenzVec(474, 116, 554) to "§6Goblin Hideout"
+ )
+
+ var showWaypoints = false
+
+ @SubscribeEvent
+ fun onTick(event: LorenzTickEvent) {
+ if (!isEnabled()) return
+
+ if (event.isMod(10)) {
+ val center = LorenzVec(514.3, 106.0, 514.3)
+ showWaypoints = center.distanceToPlayerIgnoreYSq() < 1100
+ }
+ }
+
+ @SubscribeEvent
+ fun onRenderWorld(event: RenderWorldLastEvent) {
+ if (!isEnabled()) return
+
+ if (showWaypoints) {
+ for ((location, name) in coreLocations) {
+ event.drawDynamicText(location, name, 2.5)
+ }
+ }
+ }
+
+ fun isEnabled() = IslandType.CRYSTAL_HOLLOWS.isInIsland() && config.crystalHollowsNamesInCore
+
+}