From a634de05add8e61aad17acd82d121e09afc92edc Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:13:59 +0200 Subject: Added Arachne to damage indicator Added Arachne Minis Hider - Hides the nametag above arachne minis Added Arachne Boss Highlighter - Highlight the arachne boss in red and mini bosses and orange --- .../java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 + .../skyhanni/config/features/DamageIndicator.java | 5 +- .../hannibal2/skyhanni/config/features/Mobs.java | 11 ++++ .../skyhanni/features/damageindicator/BossType.kt | 4 +- .../skyhanni/features/damageindicator/MobFinder.kt | 75 +++++++++++++++++++--- .../features/mobs/AshfangMinisNametagHider.kt | 27 ++++++++ 6 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 055c645f7..d6128dd69 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -36,6 +36,7 @@ import at.hannibal2.skyhanni.features.misc.tiarelay.TiaRelayHelper; import at.hannibal2.skyhanni.features.misc.tiarelay.TiaRelayWaypoints; import at.hannibal2.skyhanni.features.misc.update.UpdateManager; import at.hannibal2.skyhanni.features.mobs.AreaMiniBossFeatures; +import at.hannibal2.skyhanni.features.mobs.AshfangMinisNametagHider; import at.hannibal2.skyhanni.features.mobs.MobHighlight; import at.hannibal2.skyhanni.features.nether.ashfang.*; import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper; @@ -256,6 +257,7 @@ public class SkyHanniMod { loadModule(new FarmingFortuneDisplay()); loadModule(new ToolTooltipTweaks()); loadModule(new CropSpeedMeter()); + loadModule(new AshfangMinisNametagHider()); Commands.INSTANCE.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 3a8d243aa..f558b638d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java @@ -56,11 +56,12 @@ public class DamageIndicator { "§bDungeon Floor 7", "§bDiana Mobs", "§bSea Creatures", - "Dummy" + "Dummy", + "§bArachne" } ) //TODO only show currently working and tested features - public List bossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9, 18, 19)); + public List bossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9, 18, 19, 21)); @Expose @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java b/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java index fbf467e31..d5a4f3057 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java @@ -52,6 +52,12 @@ public class Mobs { @ConfigAccordionId(id = 0) public boolean corruptedMobHighlight = false; + @Expose + @ConfigOption(name = "Arachne Boss", desc = "Highlight the arachne boss in red and mini bosses and orange.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean arachneBossHighlighter = true; + @Expose @ConfigOption(name = "Respawn Timers", desc = "") @ConfigEditorAccordion(id = 1) @@ -71,4 +77,9 @@ public class Mobs { @ConfigOption(name = "Enderman Teleportation Hider", desc = "Stops the Enderman Teleportation animation.") @ConfigEditorBoolean public boolean endermanTeleportationHider = true; + + @Expose + @ConfigOption(name = "Arachne Minis Hider", desc = "Hides the nametag above arachne minis.") + @ConfigEditorBoolean + public boolean hideNameTagArachneMinis = true; } 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 c0b282e18..0b8563937 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt @@ -70,7 +70,9 @@ enum class BossType(val fullName: String, val bossTypeToggle: Int, val shortName THUNDER("§cThunder", 19), LORD_JAWBUS("§cLord Jawbus", 19), - DUMMY("Dummy", 21), + DUMMY("Dummy", 20), + ARACHNE_SMALL("§cSmall Arachne", 21), + ARACHNE_BIG("§4Big Arachne", 21), //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 543949cce..9f52781b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt @@ -1,14 +1,15 @@ package at.hannibal2.skyhanni.features.damageindicator +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.dungeon.DungeonData +import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.EntityUtils.hasBossHealth import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith -import at.hannibal2.skyhanni.utils.LocationUtils -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth import at.hannibal2.skyhanni.utils.StringUtils.matchRegex -import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.client.Minecraft import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.entity.Entity @@ -295,13 +296,16 @@ class MobFinder { } } - if (entity is EntitySpider && entity.hasNameTagWith(1, "§5☠ §4Tarantula Broodfather ")) { - when { - entity.hasMaxHealth(740) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_1) - entity.hasMaxHealth(30_000) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_2) - entity.hasMaxHealth(900_000) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_3) - entity.hasMaxHealth(2_400_000) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_4) + if (entity is EntitySpider) { + if (entity.hasNameTagWith(1, "§5☠ §4Tarantula Broodfather ")) { + when { + entity.hasMaxHealth(740) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_1) + entity.hasMaxHealth(30_000) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_2) + entity.hasMaxHealth(900_000) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_3) + entity.hasMaxHealth(2_400_000) -> return EntityResult(bossType = BossType.SLAYER_SPIDER_4) + } } + checkArachne(entity)?.let { return it } } if (entity is EntityWolf) { if (entity.hasNameTagWith(1, "§c☠ §fSven Packmaster ")) { @@ -339,6 +343,57 @@ class MobFinder { return null } + private fun checkArachne(entity: EntitySpider): EntityResult? { + if (entity.hasNameTagWith(1, "[§7Lv300§8] §cArachne") || + entity.hasNameTagWith(1, "[§7Lv300§8] §lArachne") + ) { + val maxHealth = entity.baseMaxHealth + if (maxHealth == 12) { + markArachneMinis(entity) + return null + } + if (maxHealth == 4000) { + markArachneMinis(entity) + return null + } + markArachne(entity) + return EntityResult(bossType = BossType.ARACHNE_SMALL) + } + if (entity.hasNameTagWith(1, "[§7Lv500§8] §cArachne") || + entity.hasNameTagWith(1, "[§7Lv500§8] §lArachne") + ) { + val maxHealth = entity.baseMaxHealth + if (maxHealth == 12) { + markArachneMinis(entity) + return null + } + if (maxHealth == 20000) { + markArachneMinis(entity) + return null + } + markArachne(entity) + return EntityResult(bossType = BossType.ARACHNE_BIG) + } + + return null + } + + private fun markArachneMinis(entity: EntityLivingBase) { + if (SkyHanniMod.feature.mobs.arachneBossHighlighter) { + RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.GOLD.toColor().withAlpha(50)) + { SkyHanniMod.feature.slayer.slayerMinibossHighlight } + RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.slayer.slayerMinibossHighlight } + } + } + + private fun markArachne(entity: EntityLivingBase) { + if (SkyHanniMod.feature.mobs.arachneBossHighlighter) { + RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.RED.toColor().withAlpha(50)) + { SkyHanniMod.feature.slayer.slayerMinibossHighlight } + RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.slayer.slayerMinibossHighlight } + } + } + private fun checkExtraF6GiantsDelay(entity: EntityGiantZombie): Long { val uuid = entity.uniqueID diff --git a/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt b/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt new file mode 100644 index 000000000..f3709b317 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt @@ -0,0 +1,27 @@ +package at.hannibal2.skyhanni.features.mobs + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.entity.EntityLivingBase +import net.minecraft.entity.item.EntityArmorStand +import net.minecraftforge.client.event.RenderLivingEvent +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class AshfangMinisNametagHider { + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onRenderLiving(event: RenderLivingEvent.Specials.Pre) { + if (!LorenzUtils.inSkyBlock) return + if (!SkyHanniMod.feature.mobs.hideNameTagArachneMinis) return + + val entity = event.entity + if (entity !is EntityArmorStand) return + if (!entity.hasCustomName()) return + + val name = entity.name + if (name.contains("§cArachne's Brood§r")) { + event.isCanceled = true + } + } +} \ No newline at end of file -- cgit