diff options
8 files changed, 136 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f57fa78f..a36f51925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # SkyHanni - Change Log +## Version 0.8.1 + +### Misc +- Added hide the name of the mobs you need to kill in order for the Slayer boss to spawn. Exclude mobs that are damaged, corrupted, runic or semi rare. +- Added Option to hide all damage splashes, from anywhere in Skyblock. + ## Version 0.8 ### Misc diff --git a/FEATURES.md b/FEATURES.md index 7d5123b59..ddfd9ea4e 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -94,6 +94,11 @@ - Option to show the health of Voidgloom Seraph 4 during the laser phase (useful when trying to phase skip) - Show when Revenant Horror 5 is about to BOOM. +## Slayer +- Highlight slayer miniboss in blue color. +- Highlight the enderman slayer Yang Glyph (Beacon) in red color (supports beacon in hand and beacon flying) +- Hide the name of the mobs you need to kill in order for the Slayer boss to spawn. Exclude mobs that are damaged, corrupted, runic or semi rare. + ## Commands - /wiki (using hypixel-skyblock.fandom.com instead of Hypixel wiki) - /shmarkplayer <player> (marking a player with yellow color) @@ -106,5 +111,4 @@ - Gui element showing the real time. - Highlight the voidling extremist in pink color. - Highlight corrupted mobs in purple color. -- Highlight slayer miniboss in blue color. -- Highlight the enderman slayer Yang Glyph (Beacon) in red color (supports beacon in hand and beacon flying)
\ No newline at end of file +- Option to hide all damage splashes, from anywhere in Skyblock.
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 538da3c55..8128dfb66 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -27,6 +27,7 @@ import at.hannibal2.skyhanni.features.itemabilities.abilitycooldown.ItemAbilityC import at.hannibal2.skyhanni.features.minion.MinionFeatures; import at.hannibal2.skyhanni.features.nether.ashfang.*; import at.hannibal2.skyhanni.features.slayer.EndermanSlayerBeacon; +import at.hannibal2.skyhanni.features.slayer.HideMobNames; import at.hannibal2.skyhanni.features.slayer.HighlightSlayerMiniboss; import at.hannibal2.skyhanni.features.summonings.SummoningMobManager; import at.hannibal2.skyhanni.features.summonings.SummoningSoulsName; @@ -119,6 +120,8 @@ public class SkyHanniMod { registerEvent(new DungeonCopilot()); registerEvent(new EndermanSlayerBeacon()); registerEvent(new FireVeilWandParticles()); + registerEvent(new HideMobNames()); + registerEvent(new HideDamageSplash()); Commands.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 6fa5b8b2d..d8b08a0ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -52,4 +52,9 @@ public class Misc { @ConfigOption(name = "Corrupted Mob Highlight", desc = "Highlight corrupted mobs in purple color") @ConfigEditorBoolean public boolean corruptedMobHighlight = false; + + @Expose + @ConfigOption(name = "Hide Damage Splash", desc = "Hide all damage splashes, from anywhere in Skyblock.") + @ConfigEditorBoolean + public boolean hideDamageSplash = false; }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java index cac13b109..e401b463f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java @@ -15,4 +15,9 @@ public class Slayer { @ConfigOption(name = "Slayer Enderman Beacon", desc = "Highlight the enderman slayer Yang Glyph (Beacon) in red color (supports beacon in hand and beacon flying)") @ConfigEditorBoolean public boolean slayerEndermanBeacon = false; + + @Expose + @ConfigOption(name = "Hide Mob Names", desc = "Hide the name of the mobs you need to kill in order for the Slayer boss to spawn. Exclude mobs that are damaged, corrupted, runic or semi rare.") + @ConfigEditorBoolean + public boolean hideMobNames = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/HideDamageSplash.kt b/src/main/java/at/hannibal2/skyhanni/features/HideDamageSplash.kt new file mode 100644 index 000000000..23146f5f6 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/HideDamageSplash.kt @@ -0,0 +1,22 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.entity.EntityLivingBase +import net.minecraftforge.client.event.RenderLivingEvent +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class HideDamageSplash { + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onRenderDamage(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) { + if (!LorenzUtils.inSkyblock) return + if (!SkyHanniMod.feature.misc.hideDamageSplash) return + + if (DamageIndicatorManager.isDamageSplash(event.entity)) { + event.isCanceled = true + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossHideDamageSplash.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossHideDamageSplash.kt index 62d28d3cb..101e2dd08 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossHideDamageSplash.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossHideDamageSplash.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager +import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.EntityLivingBase import net.minecraftforge.client.event.RenderLivingEvent import net.minecraftforge.fml.common.eventhandler.EventPriority @@ -11,6 +12,7 @@ class DungeonBossHideDamageSplash { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) { + if (!LorenzUtils.inDungeons) return if (!SkyHanniMod.feature.dungeon.damageSplashBoss) return if (!DungeonData.inBossRoom) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt new file mode 100644 index 000000000..383419cda --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt @@ -0,0 +1,87 @@ +package at.hannibal2.skyhanni.features.slayer + +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 +import java.util.regex.Pattern + +class HideMobNames { + + private val lastMobName = mutableMapOf<EntityArmorStand, String>() + private val mobNamesHidden = mutableListOf<EntityArmorStand>() + private val patterns = mutableListOf<Pattern>() + + init { + addMobToHide("Zombie") + addMobToHide("Zombie") + addMobToHide("Zombie Villager") + addMobToHide("Crypt Ghoul") + + addMobToHide("Dasher Spider") + addMobToHide("Weaver Spider") + addMobToHide("Splitter Spider") + addMobToHide("Voracious Spider") + addMobToHide("Silverfish") + + addMobToHide("Wolf") + addMobToHide("§bHowling Spirit") + addMobToHide("§bPack Spirit") + + addMobToHide("Enderman") + addMobToHide("Voidling Fanatic") + + addMobToHide("Blaze") // 1.2m + addMobToHide("Mutated Blaze") // 1.5m + addMobToHide("Bezal") // 2m + addMobToHide("Smoldering Blaze") // 5.5m + } + + private fun addMobToHide(bossName: String) { + patterns.add(Pattern.compile("§8\\[§7Lv(\\d+)§8] §c$bossName§r §[ae](.+)§f/§a(.+)§c❤")) + } + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) { + if (!LorenzUtils.inSkyblock) return + if (!SkyHanniMod.feature.slayer.hideMobNames) return + + val entity = event.entity + if (entity !is EntityArmorStand) return + if (!entity.hasCustomName()) return + + val name = entity.name + if (lastMobName.getOrDefault(entity, "abc") == name) { + if (entity in mobNamesHidden) { + event.isCanceled = true + } + return + } + + lastMobName[entity] = name + mobNamesHidden.remove(entity) + + if (shouldNameBeHidden(name)) { + event.isCanceled = true + mobNamesHidden.add(entity) + } + } + + private fun shouldNameBeHidden(name: String): Boolean { + for (pattern in patterns) { + val matcher = pattern.matcher(name) + if (matcher.matches()) { + val min = matcher.group(2) + val max = matcher.group(3) + if (min == max || min == "0") { + return true + } + } + } + + return false + } +}
\ No newline at end of file |