aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-24 11:34:36 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-24 11:34:36 +0200
commit6c701a4b4ce53bf95f8bb70af9cd30d0467878a7 (patch)
treeb77a2d9a49ba8e363f1440ce13b091cafee74693 /src/main/java/at/hannibal2
parentd79fc0ac187b4fc14228a5d83200d382e98b6bbe (diff)
downloadskyhanni-6c701a4b4ce53bf95f8bb70af9cd30d0467878a7.tar.gz
skyhanni-6c701a4b4ce53bf95f8bb70af9cd30d0467878a7.tar.bz2
skyhanni-6c701a4b4ce53bf95f8bb70af9cd30d0467878a7.zip
added Ashfang Blazing Souls display
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java36
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java57
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt63
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt4
8 files changed, 134 insertions, 44 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index 81ccc5658..49eca4470 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -29,6 +29,7 @@ import at.hannibal2.skyhanni.features.items.ItemStars;
import at.hannibal2.skyhanni.features.items.RngMeterInventory;
import at.hannibal2.skyhanni.features.items.abilitycooldown.ItemAbilityCooldown;
import at.hannibal2.skyhanni.features.minion.MinionFeatures;
+import at.hannibal2.skyhanni.features.nether.ashfang.AshfangBlazingSouls;
import at.hannibal2.skyhanni.features.nether.ashfang.AshfangFreezeCooldown;
import at.hannibal2.skyhanni.features.nether.ashfang.AshfangGravityOrbs;
import at.hannibal2.skyhanni.features.nether.ashfang.AshfangNextResetCooldown;
@@ -90,6 +91,7 @@ public class SkyHanniMod {
registerEvent(new AshfangNextResetCooldown());
registerEvent(new SummoningSoulsName());
registerEvent(new AshfangGravityOrbs());
+ registerEvent(new AshfangBlazingSouls());
registerEvent(new ItemStars());
registerEvent(new MinionFeatures());
registerEvent(new RealTime());
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java
index e167e9142..56a78c3c8 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Features.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java
@@ -53,12 +53,12 @@ public class Features {
}
if (runnableId.equals("ashfangFreezeCooldown")) {
- editOverlay(activeConfigCategory, 200, 16, abilities.ashfangFreezeCooldownPos);
+ editOverlay(activeConfigCategory, 200, 16, ashfang.freezeCooldownPos);
return;
}
if (runnableId.equals("ashfangResetCooldown")) {
- editOverlay(activeConfigCategory, 200, 16, abilities.ashfangNextResetCooldownPos);
+ editOverlay(activeConfigCategory, 200, 16, ashfang.nextResetCooldownPos);
return;
}
@@ -90,6 +90,10 @@ public class Features {
public Abilities abilities = new Abilities();
@Expose
+ @Category(name = "Ashfang", desc = "Ashfang fight in Crimson Isle")
+ public Ashfang ashfang = new Ashfang();
+
+ @Expose
@Category(name = "Minion", desc = "Stuff about minions")
public Minions minions = new Minions();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java b/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
index 8c7c0074b..646047710 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
@@ -1,9 +1,6 @@
package at.hannibal2.skyhanni.config.features;
-import at.hannibal2.skyhanni.config.gui.core.config.Position;
import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorBoolean;
-import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorButton;
-import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorColour;
import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigOption;
import com.google.gson.annotations.Expose;
@@ -18,37 +15,4 @@ public class Abilities {
@ConfigOption(name = "Ability Cooldown Background", desc = "Show the cooldown color of item abilities in the background.")
@ConfigEditorBoolean
public boolean itemAbilityCooldownBackground = false;
-
- @Expose
- @ConfigOption(name = "Ashfang Freeze", desc = "Show the cooldown how long Ashfang blocks all your abilities.")
- @ConfigEditorBoolean
- public boolean ashfangFreezeCooldown = false;
-
- @Expose
- @ConfigOption(name = "Ashfang Freeze Position", desc = "")
- @ConfigEditorButton(runnableId = "ashfangFreezeCooldown", buttonText = "Edit")
- public Position ashfangFreezeCooldownPos = new Position(10, 10, false, true);
-
- @Expose
- @ConfigOption(name = "Ashfang Reset", desc = "Shows the cooldown until ashfang pulls his underlings back")
- @ConfigEditorBoolean
- public boolean ashfangNextResetCooldown = false;
-
- @Expose
- @ConfigOption(name = "Ashfang Reset Position", desc = "")
- @ConfigEditorButton(runnableId = "ashfangResetCooldown", buttonText = "Edit")
- public Position ashfangNextResetCooldownPos = new Position(10, 10, false, true);
-
- @Expose
- @ConfigOption(name = "Ashfang Gravity Orbs", desc = "Showing the gravity Orbs more clearly")
- @ConfigEditorBoolean
- public boolean ashfangGravityOrbs = false;
-
- @Expose
- @ConfigOption(
- name = "Orbs Color",
- desc = "Color of the Ashfang Gravity Orbs"
- )
- @ConfigEditorColour
- public String ashfangGravityOrbsColor = "0:245:255:85:85";
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java b/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java
new file mode 100644
index 000000000..bf3d68f52
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java
@@ -0,0 +1,57 @@
+package at.hannibal2.skyhanni.config.features;
+
+import at.hannibal2.skyhanni.config.gui.core.config.Position;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorBoolean;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorButton;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorColour;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigOption;
+import com.google.gson.annotations.Expose;
+
+public class Ashfang {
+
+ @Expose
+ @ConfigOption(name = "Ashfang Freeze", desc = "Show the cooldown how long Ashfang blocks all your abilities.")
+ @ConfigEditorBoolean
+ public boolean freezeCooldown = false;
+
+ @Expose
+ @ConfigOption(name = "Ashfang Freeze Position", desc = "")
+ @ConfigEditorButton(runnableId = "ashfangFreezeCooldown", buttonText = "Edit")
+ public Position freezeCooldownPos = new Position(10, 10, false, true);
+
+ @Expose
+ @ConfigOption(name = "Ashfang Reset", desc = "Shows the cooldown until ashfang pulls his underlings back")
+ @ConfigEditorBoolean
+ public boolean nextResetCooldown = false;
+
+ @Expose
+ @ConfigOption(name = "Ashfang Reset Position", desc = "")
+ @ConfigEditorButton(runnableId = "ashfangResetCooldown", buttonText = "Edit")
+ public Position nextResetCooldownPos = new Position(10, 10, false, true);
+
+ @Expose
+ @ConfigOption(name = "Ashfang Gravity Orbs", desc = "Showing the Gravity Orbs more clearly")
+ @ConfigEditorBoolean
+ public boolean gravityOrbs = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Orbs Color",
+ desc = "Color of the Ashfang Gravity Orbs"
+ )
+ @ConfigEditorColour
+ public String gravityOrbsColor = "0:245:255:85:85";
+
+ @Expose
+ @ConfigOption(name = "Ashfang Blazing Souls", desc = "Showing the Blazing Souls more clearly")
+ @ConfigEditorBoolean
+ public boolean blazingSouls = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Souls Color",
+ desc = "Color of the Ashfang Blazing Souls"
+ )
+ @ConfigEditorColour
+ public String blazingSoulsColor = "0:245:85:255:85";
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
new file mode 100644
index 000000000..734db29ea
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
@@ -0,0 +1,63 @@
+package at.hannibal2.skyhanni.features.nether.ashfang
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
+import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture
+import at.hannibal2.skyhanni.utils.LocationUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils.drawString
+import at.hannibal2.skyhanni.utils.SpecialColour
+import at.hannibal2.skyhanni.utils.getLorenzVec
+import net.minecraft.client.Minecraft
+import net.minecraft.entity.item.EntityArmorStand
+import net.minecraftforge.client.event.RenderWorldLastEvent
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent
+import java.awt.Color
+
+class AshfangBlazingSouls {
+
+ private val texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODI4N2IzOTdkYWY5NTE2YTBiZDc2ZjVmMWI3YmY5Nzk1MTVkZjNkNWQ4MzNlMDYzNWZhNjhiMzdlZTA4MjIxMiJ9fX0="
+ private val souls = mutableListOf<EntityArmorStand>()
+
+ @SubscribeEvent
+ fun onTick(event: TickEvent.ClientTickEvent) {
+ if (!isEnabled()) return
+
+ Minecraft.getMinecraft().theWorld.loadedEntityList
+ .filter { it ->
+ it is EntityArmorStand && it !in souls && it.inventory
+ .any { it != null && it.getSkullTexture() == texture }
+ }.forEach { souls.add(it as EntityArmorStand) }
+ }
+
+ @SubscribeEvent
+ fun onRenderWorld(event: RenderWorldLastEvent) {
+ if (!isEnabled()) return
+
+ val special = SkyHanniMod.feature.ashfang.blazingSoulsColor
+
+ val color = Color(SpecialColour.specialToChromaRGB(special), true)
+
+ val playerLocation = LocationUtils.playerLocation()
+ for (orb in souls) {
+ if (orb.isDead) continue
+ val orbLocation = orb.getLorenzVec()
+ event.drawWaypointFilled(orbLocation.add(-0.5, 1.25, -0.5), color)
+ if (orbLocation.distance(playerLocation) < 10) {
+ //TODO find way to dynamically change color
+ event.drawString(orbLocation.add(0.0, 2.5, 0.0), "§bBlazing Soul")
+ }
+ }
+ }
+
+ @SubscribeEvent
+ fun renderOverlay(event: WorldEvent.Load) {
+ souls.clear()
+ }
+
+ private fun isEnabled(): Boolean {
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.blazingSouls
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
index af36884ca..20a6c7bd5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
@@ -33,11 +33,11 @@ class AshfangFreezeCooldown {
if (remainingLong > 0) {
val remaining = (remainingLong.toFloat() / 1000)
val format = DecimalFormat("0.0").format(remaining + 0.1)
- SkyHanniMod.feature.abilities.ashfangFreezeCooldownPos.renderString("§cAshfang Freeze: §a${format}s")
+ SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString("§cAshfang Freeze: §a${format}s")
}
}
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangFreezeCooldown
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.freezeCooldown
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
index ed1abeacb..59a128957 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
@@ -37,7 +37,7 @@ class AshfangGravityOrbs {
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!isEnabled()) return
- val special = SkyHanniMod.feature.abilities.ashfangGravityOrbsColor
+ val special = SkyHanniMod.feature.ashfang.gravityOrbsColor
val color = Color(SpecialColour.specialToChromaRGB(special), true)
@@ -59,6 +59,6 @@ class AshfangGravityOrbs {
}
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangGravityOrbs
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.gravityOrbs
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
index 7828b28b2..0f8d617d1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
@@ -36,7 +36,7 @@ class AshfangNextResetCooldown {
if (remainingTime > 0) {
val remaining = (remainingTime.toFloat() / 1000)
val format = DecimalFormat("0.0").format(remaining + 0.1)
- SkyHanniMod.feature.abilities.ashfangNextResetCooldownPos.renderString("§cAshfang next reset in: §a${format}s")
+ SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a${format}s")
} else {
spawnTime = -1
}
@@ -48,6 +48,6 @@ class AshfangNextResetCooldown {
}
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangNextResetCooldown
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.nextResetCooldown
}
} \ No newline at end of file