diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-07 11:06:16 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-07 11:06:16 +0200 |
commit | af192ed7327735f5ac590f65d30a001d68815e06 (patch) | |
tree | f8ae518ee552d86c634eccb3d28f31c9ee01b4c7 /src/main/java/at | |
parent | ab0e2df6feae63caec66143a5328ad1c95adff82 (diff) | |
download | skyhanni-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')
4 files changed, 56 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 51e6c2c3c..06a1fab85 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -46,6 +46,7 @@ import at.hannibal2.skyhanni.features.itemabilities.FireVeilWandParticles import at.hannibal2.skyhanni.features.itemabilities.abilitycooldown.ItemAbilityCooldown import at.hannibal2.skyhanni.features.mining.HighlightMiningCommissionMobs import at.hannibal2.skyhanni.features.mining.KingTalismanHelper +import at.hannibal2.skyhanni.features.mining.crystalhollows.CrystalHollowsNamesInCore import at.hannibal2.skyhanni.features.minion.MinionCollectLogic import at.hannibal2.skyhanni.features.minion.MinionFeatures import at.hannibal2.skyhanni.features.misc.* @@ -100,7 +101,6 @@ import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.test.* import at.hannibal2.skyhanni.test.command.CopyNearbyParticlesCommand import at.hannibal2.skyhanni.utils.MinecraftConsoleFilter.Companion.initLogging -import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NEUVersionCheck.checkIfNeuIsLoaded import at.hannibal2.skyhanni.utils.TabListData import kotlinx.coroutines.CoroutineName @@ -288,6 +288,7 @@ class SkyHanniMod { loadModule(WrongFungiCutterWarning()) loadModule(FarmingArmorDrops()) loadModule(JoinCrystalHollows()) + loadModule(CrystalHollowsNamesInCore()) loadModule(GardenVisitorColorNames()) loadModule(TeleportPadCompactName()) loadModule(AnitaMedalProfit()) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index a1741affb..533c1dc05 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -675,6 +675,11 @@ public class MiscConfig { @Expose public Position kingTalismanHelperPos = new Position(-400, 220, false, true); + + @Expose + @ConfigOption(name = "Names in Core", desc = "Show the names of the 4 areas while in the center of crystal hollows.") + @ConfigEditorBoolean + public boolean crystalHollowsNamesInCore = false; } @Expose 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 + +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt index 1c1bd5b1b..9fcba58f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt @@ -14,6 +14,8 @@ object LocationUtils { fun LorenzVec.distanceToPlayer() = distance(playerLocation()) + fun LorenzVec.distanceToPlayerIgnoreYSq() = distanceIgnoreYSq(playerLocation()) + fun Entity.distanceToPlayer() = getLorenzVec().distance(playerLocation()) fun Entity.distanceTo(location: LorenzVec) = getLorenzVec().distance(location) |