diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-09-14 13:12:01 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-09-14 13:12:01 +0200 |
commit | f13a583115443f732cbf5745d365cf02325efe1e (patch) | |
tree | 8514b30db7a89e5864eb1c2e7ab2ed3472fb44c9 /src/main/java/at/hannibal2/skyhanni | |
parent | fb2ec4494ec986cfdfcd9de6b9cacfe157f0ffdc (diff) | |
download | skyhanni-f13a583115443f732cbf5745d365cf02325efe1e.tar.gz skyhanni-f13a583115443f732cbf5745d365cf02325efe1e.tar.bz2 skyhanni-f13a583115443f732cbf5745d365cf02325efe1e.zip |
added Thunder to damage indicator and added Thunder Spark Highlight
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
6 files changed, 98 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 8a27200c9..4c5bfa561 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -122,6 +122,7 @@ public class SkyHanniMod { registerEvent(new FireVeilWandParticles()); registerEvent(new HideMobNames()); registerEvent(new HideDamageSplash()); + registerEvent(new ThunderSparksHighlight()); Commands.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java index 0062067b9..b14caba94 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java @@ -55,6 +55,7 @@ public class DamageIndicator { "\u00a7bDungeon Floor 6", "\u00a7bDungeon Floor 7", "\u00a7bDiana Mobs", + "\u00a7bThunder", "Dummy" } ) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java b/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java index ce882e3dd..4632ccfb4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java @@ -1,23 +1,47 @@ package at.hannibal2.skyhanni.config.features; -import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; -import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.core.config.annotations.*; import com.google.gson.annotations.Expose; public class Fishing { + @ConfigOption(name = "Trophy Fishing", desc = "") + @ConfigEditorAccordion(id = 0) + public boolean trophyFishing = false; + @Expose @ConfigOption(name = "Trophy Counter", desc = "Counts every single Trohy message from chat and tells you how many you got already.") @ConfigEditorBoolean + @ConfigAccordionId(id = 0) public boolean trophyCounter = false; @Expose @ConfigOption(name = "Hide Bronze Duplicates", desc = "Hide duplicate messages for bronze trophy fishes from chat.") @ConfigEditorBoolean + @ConfigAccordionId(id = 0) public boolean trophyFishBronzeHider = false; @Expose @ConfigOption(name = "Shorten Fishing Message", desc = "Shorten the message what type of sea creature you have fished.") @ConfigEditorBoolean public boolean shortenFishingMessage = false; + + @ConfigOption(name = "Thunder Spark", desc = "") + @ConfigEditorAccordion(id = 1) + public boolean thunderSpark = false; + + @Expose + @ConfigOption(name = "Thunder Spark Highlight", desc = "Highlight Thunder Sparks after killing a Thunder") + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean thunderSparkHighlight = false; + + @Expose + @ConfigOption( + name = "Thunder Spark Color", + desc = "Color of the Thunder Sparks" + ) + @ConfigEditorColour + @ConfigAccordionId(id = 1) + public String thunderSparkColor = "0:245:FF:FF:FF"; }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt new file mode 100644 index 000000000..9c8b9fd11 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt @@ -0,0 +1,62 @@ +package at.hannibal2.skyhanni.features + +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 ThunderSparksHighlight { + + private val texture = + "ewogICJ0aW1lc3RhbXAiIDogMTY0MzUwNDM3MjI1NiwKICAicHJvZmlsZUlkIiA6ICI2MzMyMDgwZTY3YTI0Y2MxYjE3ZGJhNzZmM2MwMGYxZCIsCiAgInByb2ZpbGVOYW1lIiA6ICJUZWFtSHlkcmEiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2IzMzI4ZDNlOWQ3MTA0MjAzMjI1NTViMTcyMzkzMDdmMTIyNzBhZGY4MWJmNjNhZmM1MGZhYTA0YjVjMDZlMSIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9" + private val sparks = mutableListOf<EntityArmorStand>() + + @SubscribeEvent + fun onTick(event: TickEvent.ClientTickEvent) { + if (!isEnabled()) return + + Minecraft.getMinecraft().theWorld.loadedEntityList + .filter { it -> + it is EntityArmorStand && it !in sparks && it.inventory + .any { it != null && it.getSkullTexture() == texture } + }.forEach { sparks.add(it as EntityArmorStand) } + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!isEnabled()) return + + val special = SkyHanniMod.feature.fishing.thunderSparkColor + val color = Color(SpecialColour.specialToChromaRGB(special), true) + + val playerLocation = LocationUtils.playerLocation() + for (spark in sparks) { + if (spark.isDead) continue + val sparkLocation = spark.getLorenzVec() + event.drawWaypointFilled(sparkLocation.add(-0.5, 0.0, -0.5), color, extraSize = -0.25) + if (sparkLocation.distance(playerLocation) < 10) { + event.drawString(sparkLocation.add(0.0, 1.5, 0.0), "Thunder Spark") + } + } + } + + @SubscribeEvent + fun onWorldChange(event: WorldEvent.Load) { + sparks.clear() + } + + private fun isEnabled(): Boolean { + return LorenzUtils.inSkyblock && SkyHanniMod.feature.fishing.thunderSparkHighlight + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt index a2e8a83ad..a013bcc63 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt @@ -53,7 +53,9 @@ enum class BossType(val fullName: String, val bossTypeToggle: Int, val shortName GAIA_CONSTURUCT("§2Gaia Construct", 18), MINOTAUR("§2Minotaur", 18), - DUMMY("Dummy", 19), + THUNDER("§cThunder", 19), + + DUMMY("Dummy", 20), //TODO arachne diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt index cefac9a25..43c0e4552 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt @@ -306,6 +306,11 @@ class MobFinder { return EntityResult(bossType = BossType.GAIA_CONSTURUCT) } } + if (entity is EntityGuardian) { + if (entity.hasMaxHealth(35_000_000)) { + return EntityResult(bossType = BossType.THUNDER) + } + } } return null |