aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/event
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-10-11 13:26:14 -0400
committerGitHub <noreply@github.com>2024-10-11 19:26:14 +0200
commit925bb0964d502bdecf74ad14002bdf7c57bb44d6 (patch)
treec1f2de400a4cae2c709d0a5b0193868f968ff54c /src/main/java/at/hannibal2/skyhanni/features/event
parent46824035c67b50320e1d12f16d0692d3ef261ece (diff)
downloadskyhanni-925bb0964d502bdecf74ad14002bdf7c57bb44d6.tar.gz
skyhanni-925bb0964d502bdecf74ad14002bdf7c57bb44d6.tar.bz2
skyhanni-925bb0964d502bdecf74ad14002bdf7c57bb44d6.zip
Feature: Highlight Crystal Nucleus Crystals (#2598)
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/NucleusBarriersBox.kt81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/NucleusBarriersBox.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/NucleusBarriersBox.kt
new file mode 100644
index 000000000..47ab47a38
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/NucleusBarriersBox.kt
@@ -0,0 +1,81 @@
+package at.hannibal2.skyhanni.features.event.hoppity
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
+import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.features.misc.IslandAreas
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
+import at.hannibal2.skyhanni.utils.LorenzColor
+import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
+import at.hannibal2.skyhanni.utils.RenderUtils.drawFilledBoundingBox_nea
+import at.hannibal2.skyhanni.utils.RenderUtils.expandBlock
+import net.minecraft.util.AxisAlignedBB
+import net.minecraft.util.BlockPos
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+@SkyHanniModule
+object NucleusBarriersBox {
+ private val config get() = SkyHanniMod.feature.mining.crystalHighlighter
+
+ private var inNucleus = false
+
+ private enum class Crystal(val color: LorenzColor, val boundingBox: AxisAlignedBB) {
+ AMBER(
+ LorenzColor.GOLD,
+ AxisAlignedBB(
+ BlockPos(474.0, 124.0, 524.0),
+ BlockPos(485.0, 111.0, 535.0),
+ ).expandBlock(),
+ ),
+ AMETHYST(
+ LorenzColor.DARK_PURPLE,
+ AxisAlignedBB(
+ BlockPos(474.0, 124.0, 492.0),
+ BlockPos(485.0, 111.0, 503.0),
+ ).expandBlock(),
+ ),
+ TOPAZ(
+ LorenzColor.YELLOW,
+ AxisAlignedBB(
+ BlockPos(508.0, 124.0, 473.0),
+ BlockPos(519.0, 111.0, 484.0),
+ ).expandBlock(),
+ ),
+ JADE(
+ LorenzColor.GREEN,
+ AxisAlignedBB(
+ BlockPos(542.0, 124.0, 492.0),
+ BlockPos(553.0, 111.0, 503.0),
+ ).expandBlock(),
+ ),
+ SAPPHIRE(
+ LorenzColor.BLUE,
+ AxisAlignedBB(
+ BlockPos(542.0, 124.0, 524.0),
+ BlockPos(553.0, 111.0, 535.0),
+ ).expandBlock(),
+ ),
+ }
+
+ @SubscribeEvent
+ fun onTick(event: LorenzTickEvent) {
+ inNucleus = IslandAreas.currentAreaName == "Crystal Nucleus"
+ }
+
+ @SubscribeEvent
+ fun onRenderWorld(event: LorenzRenderWorldEvent) {
+ if (!isEnabled()) return
+
+ Crystal.entries.forEach { crystal ->
+ event.drawFilledBoundingBox_nea(
+ crystal.boundingBox,
+ crystal.color.addOpacity(config.opacity),
+ renderRelativeToCamera = false,
+ )
+ }
+ }
+
+ private fun isEnabled() =
+ IslandType.CRYSTAL_HOLLOWS.isInIsland() && (HoppityAPI.isHoppityEvent() || !config.onlyDuringHoppity) && config.enabled && inNucleus
+}