aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-04-27 13:43:51 +0200
committerGitHub <noreply@github.com>2024-04-27 13:43:51 +0200
commit5597d58047a2232274c7d2a094b5276f4a7795c6 (patch)
tree69402cb3fc7fa5b35725d0116263ac823c4d6fec /src/main/java/at/hannibal2/skyhanni
parentcabc3aa250d073942f414e795f625e88ff827f45 (diff)
downloadskyhanni-5597d58047a2232274c7d2a094b5276f4a7795c6.tar.gz
skyhanni-5597d58047a2232274c7d2a094b5276f4a7795c6.tar.bz2
skyhanni-5597d58047a2232274c7d2a094b5276f4a7795c6.zip
Feature: Matriarch Helper (#1385)
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')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/CrimsonIsleConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/MatriarchHelperConfig.java36
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt71
4 files changed, 115 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index df4f6e534..178ff4076 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -352,6 +352,7 @@ import at.hannibal2.skyhanni.features.misc.trevor.TrevorSolver
import at.hannibal2.skyhanni.features.misc.trevor.TrevorTracker
import at.hannibal2.skyhanni.features.misc.update.UpdateManager
import at.hannibal2.skyhanni.features.misc.visualwords.ModifyVisualWords
+import at.hannibal2.skyhanni.features.nether.MatriarchHelper
import at.hannibal2.skyhanni.features.nether.PabloHelper
import at.hannibal2.skyhanni.features.nether.SulphurSkitterBox
import at.hannibal2.skyhanni.features.nether.VolcanoExplosivityDisplay
@@ -668,6 +669,7 @@ class SkyHanniMod {
loadModule(CompactBingoChat())
loadModule(BrewingStandOverlay())
loadModule(FishingTimer())
+ loadModule(MatriarchHelper())
loadModule(LesserOrbHider())
loadModule(FishingHookDisplay())
loadModule(CrimsonIsleReputationHelper(this))
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/CrimsonIsleConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/CrimsonIsleConfig.java
index 07257ab3c..7924ffe02 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/CrimsonIsleConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/CrimsonIsleConfig.java
@@ -22,6 +22,11 @@ public class CrimsonIsleConfig {
public ReputationHelperConfig reputationHelper = new ReputationHelperConfig();
@Expose
+ @ConfigOption(name = "Matriach Helper", desc = "Helper for Heavy Pearls")
+ @Accordion
+ public MatriarchHelperConfig matriarchHelper = new MatriarchHelperConfig();
+
+ @Expose
@ConfigOption(name = "Pablo NPC Helper", desc = "Shows a clickable message that grabs the flower needed from your sacks.")
@ConfigEditorBoolean
@FeatureToggle
@@ -47,4 +52,5 @@ public class CrimsonIsleConfig {
@Expose
@ConfigLink(owner = CrimsonIsleConfig.class, field = "showDojoRankDisplay")
public Position dojoRankDisplayPosition = new Position(-378, 206, false, true);
+
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/MatriarchHelperConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/MatriarchHelperConfig.java
new file mode 100644
index 000000000..a8c8ec9ac
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/crimsonisle/MatriarchHelperConfig.java
@@ -0,0 +1,36 @@
+package at.hannibal2.skyhanni.config.features.crimsonisle;
+
+import at.hannibal2.skyhanni.config.FeatureToggle;
+import com.google.gson.annotations.Expose;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
+
+public class MatriarchHelperConfig {
+
+ @Expose
+ @ConfigOption(name = "Enabled", desc = "Enable features around the Matriarch helper.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean enabled = true;
+
+ @Expose
+ @ConfigOption(name = "Highlight", desc = "Highlight the pearls in a color of your choosing.")
+ @ConfigEditorBoolean
+ public boolean highlight = true;
+
+ @Expose
+ @ConfigOption(name = "Highlight Color", desc = "Colour the pearls are highlighted in.")
+ @ConfigEditorColour
+ public String highlightColor = "0:114:126:255:41";
+
+ @Expose
+ @ConfigOption(name = "Draw Line", desc = "Draw Line to the lowest Heavy Pearl.")
+ @ConfigEditorBoolean
+ public boolean line = true;
+
+ @Expose
+ @ConfigOption(name = "Line Color", desc = "Colour of the line.")
+ @ConfigEditorColour
+ public String lineColor = "0:230:163:38:255";
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt
new file mode 100644
index 000000000..24d70e12c
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt
@@ -0,0 +1,71 @@
+package at.hannibal2.skyhanni.features.nether
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.data.mob.Mob
+import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
+import at.hannibal2.skyhanni.events.MobEvent
+import at.hannibal2.skyhanni.test.command.CopyNearbyEntitiesCommand.getMobInfo
+import at.hannibal2.skyhanni.test.command.ErrorManager
+import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
+import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
+import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine
+import at.hannibal2.skyhanni.utils.RenderUtils.drawFilledBoundingBox_nea
+import at.hannibal2.skyhanni.utils.RenderUtils.exactPlayerEyeLocation
+import at.hannibal2.skyhanni.utils.RenderUtils.expandBlock
+import at.hannibal2.skyhanni.utils.getLorenzVec
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.util.TreeSet
+
+class MatriarchHelper {
+
+ private val config get() = SkyHanniMod.feature.crimsonIsle.matriarchHelper
+
+ private val pearlList = TreeSet<Mob> { first, second ->
+ first.baseEntity.getLorenzVec().y.compareTo(second.baseEntity.getLorenzVec().y)
+ }
+
+ @SubscribeEvent
+ fun onMobSpawn(event: MobEvent.Spawn.Special) {
+ if (!isHeavyPearl(event)) return
+ pearlList.add(event.mob)
+ if (pearlList.size > 3) {
+ ErrorManager.logErrorStateWithData(
+ "Something went wrong with the Heavy Pearl detection",
+ "More then 3 pearls",
+ "pearList" to pearlList.map { getMobInfo(it) }
+ )
+ pearlList.clear()
+ }
+ }
+
+ private fun isHeavyPearl(event: MobEvent) = isEnabled() && event.mob.name == "Heavy Pearl"
+
+ @SubscribeEvent
+ fun onMobDespawn(event: MobEvent.DeSpawn.Special) {
+ if (!isHeavyPearl(event)) return
+ pearlList.remove(event.mob)
+ }
+
+ @SubscribeEvent
+ fun onRender(event: LorenzRenderWorldEvent) {
+ if (!isEnabled()) return
+ if (config.highlight) {
+ val color = config.highlightColor.toChromaColor()
+ pearlList.forEach {
+ event.drawFilledBoundingBox_nea(it.boundingBox.expandBlock(), color, 1.0f)
+ }
+ }
+ if (config.line) {
+ val color = config.lineColor.toChromaColor()
+ var prePoint = event.exactPlayerEyeLocation()
+ pearlList.forEach {
+ val point = it.baseEntity.getLorenzVec().add(y = 1.2)
+ event.draw3DLine(prePoint, point, color, 10, true)
+ prePoint = point
+ }
+ }
+ }
+
+ fun isEnabled() = config.enabled && IslandType.CRIMSON_ISLE.isInIsland()
+}