diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-17 08:33:32 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-17 08:33:32 +0200 |
commit | e27b4ea5a0b4546a7b984a3dc5b1522a7b1648bb (patch) | |
tree | a121fcea28a783543ab6c2d5b0da4c1b71e62f35 /src/main/java | |
parent | 870d973ae9cda04430319c070ed6d90ac11435c0 (diff) | |
download | skyhanni-e27b4ea5a0b4546a7b984a3dc5b1522a7b1648bb.tar.gz skyhanni-e27b4ea5a0b4546a7b984a3dc5b1522a7b1648bb.tar.bz2 skyhanni-e27b4ea5a0b4546a7b984a3dc5b1522a7b1648bb.zip |
migrate mobs nad summoning config into combat
Diffstat (limited to 'src/main/java')
10 files changed, 154 insertions, 173 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 29123ee00..1acc0a393 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -64,10 +64,6 @@ public class Features extends Config { public ItemAbilityConfig itemAbilities = new ItemAbilityConfig(); @Expose - @Category(name = "Summonings", desc = "Mobs you revive.") - public SummoningsConfig summonings = new SummoningsConfig(); - - @Expose @Category(name = "Crimson Isle", desc = "Things to do on the Crimson Isle/Nether island.") public CrimsonIsleConfig crimsonIsle = new CrimsonIsleConfig(); @@ -108,10 +104,6 @@ public class Features extends Config { public BingoConfig bingo = new BingoConfig(); @Expose - @Category(name = "Mobs", desc = "Visual help for Mobs") - public MobsConfig mobs = new MobsConfig(); - - @Expose @Category(name = "Garden", desc = "Features on the Garden island.") public GardenConfig garden = new GardenConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java index 75f8c063c..88b7256af 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java @@ -475,6 +475,126 @@ public class CombatConfig { } @Expose + @ConfigOption(name = "Summonings", desc = "") + @Accordion + public SummoningsConfig summonings = new SummoningsConfig(); + + public static class SummoningsConfig { + + @Expose + @ConfigOption(name = "Summoning Soul Display", desc = "Show the name of dropped Summoning Souls laying on the ground. " + + "§cNot working in dungeons if Skytils' 'Hide Non-Starred Mobs Nametags' feature is enabled!") + @ConfigEditorBoolean + @FeatureToggle + public boolean summoningSoulDisplay = false; + + @Expose + @ConfigOption(name = "Summoning Mob Display", desc = "Show the health of your spawned summons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean summoningMobDisplay = false; + + @Expose + public Position summoningMobDisplayPos = new Position(10, 10, false, true); + + @Expose + @ConfigOption(name = "Summoning Mob Nametag", desc = "Hide the nametag of your spawned summons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean summoningMobHideNametag = false; + + @Expose + @ConfigOption(name = "Summoning Mob Color", desc = "Marks own summons green.") + @ConfigEditorBoolean + @FeatureToggle + public boolean summoningMobColored = false; + } + + @Expose + @ConfigOption(name = "Mobs", desc = "") + @Accordion + public MobsConfig mobs = new MobsConfig(); + + public static class MobsConfig { + + @Expose + @ConfigOption(name = "Highlighters", desc = "") + @ConfigEditorAccordion(id = 0) + public boolean highlighters = false; + + @Expose + @ConfigOption(name = "Area Boss", desc = "Highlight Golden Ghoul, Old Wolf, Voidling Extremist and Millenia-Aged Blaze.") + @ConfigEditorBoolean + @FeatureToggle + public boolean areaBossHighlight = true; + + @Expose + @ConfigOption(name = "Arachne Keeper", desc = "Highlight the Arachne Keeper in the Spider's Den in purple color.") + @ConfigEditorBoolean + @FeatureToggle + public boolean arachneKeeperHighlight = true; + + @Expose + @ConfigOption(name = "Corleone", desc = "Highlight Boss Corleone in the Crystal Hollows.") + @ConfigEditorBoolean + @FeatureToggle + public boolean corleoneHighlighter = true; + + @Expose + @ConfigOption(name = "Zealot", desc = "Highlight Zealots and Bruisers in The End.") + @ConfigEditorBoolean + @FeatureToggle + public boolean zealotBruiserHighlighter = false; + + @Expose + @ConfigOption( + name = "Special Zealots", + desc = "Highlight Special Zealots (the ones that drop Summoning Eyes) in the End." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean specialZealotHighlighter = true; + + @Expose + @ConfigOption(name = "Corrupted Mob", desc = "Highlight corrupted mobs in purple color.") + @ConfigEditorBoolean + @FeatureToggle + public boolean corruptedMobHighlight = false; + + @Expose + @ConfigOption(name = "Arachne Boss", desc = "Highlight the Arachne boss in red and mini-bosses in orange.") + @ConfigEditorBoolean + @FeatureToggle + public boolean arachneBossHighlighter = true; + + @Expose + @ConfigOption(name = "Respawn Timers", desc = "") + public boolean timers = false; + + @Expose + @ConfigOption( + name = "Area Boss", + desc = "Show a timer when Golden Ghoul, Old Wolf, Voidling Extremist or Millenia-Aged Blaze respawns. " + + "§cSometimes it takes 20-30 seconds to calibrate correctly." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean areaBossRespawnTimer = false; + + @Expose + @ConfigOption(name = "Enderman TP Hider", desc = "Stops the Enderman Teleportation animation.") + @ConfigEditorBoolean + @FeatureToggle + public boolean endermanTeleportationHider = true; + + @Expose + @ConfigOption(name = "Arachne Minis Hider", desc = "Hides the nametag above arachne minis.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideNameTagArachneMinis = true; + } + + @Expose @ConfigOption(name = "Hide Damage Splash", desc = "Hide all damage splashes anywhere in SkyBlock.") @ConfigEditorBoolean @FeatureToggle diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MobsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MobsConfig.java deleted file mode 100644 index b58ab06d1..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MobsConfig.java +++ /dev/null @@ -1,96 +0,0 @@ -package at.hannibal2.skyhanni.config.features; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigOption; - -public class MobsConfig { - - @Expose - @ConfigOption(name = "Highlighters", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean highlighters = false; - - @Expose - @ConfigOption(name = "Area Boss", desc = "Highlight Golden Ghoul, Old Wolf, Voidling Extremist and Millenia-Aged Blaze.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean areaBossHighlight = true; - - @Expose - @ConfigOption(name = "Arachne Keeper", desc = "Highlight the Arachne Keeper in the Spider's Den in purple color.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean arachneKeeperHighlight = true; - - @Expose - @ConfigOption(name = "Corleone", desc = "Highlight Boss Corleone in the Crystal Hollows.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean corleoneHighlighter = true; - - @Expose - @ConfigOption(name = "Zealot", desc = "Highlight Zealots and Bruisers in The End.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean zealotBruiserHighlighter = false; - - @Expose - @ConfigOption( - name = "Special Zealots", - desc = "Highlight Special Zealots (the ones that drop Summoning Eyes) in the End." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean specialZealotHighlighter = true; - - @Expose - @ConfigOption(name = "Corrupted Mob", desc = "Highlight corrupted mobs in purple color.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean corruptedMobHighlight = false; - - @Expose - @ConfigOption(name = "Arachne Boss", desc = "Highlight the Arachne boss in red and mini-bosses in orange.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean arachneBossHighlighter = true; - - @Expose - @ConfigOption(name = "Respawn Timers", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean timers = false; - - @Expose - @ConfigOption( - name = "Area Boss", - desc = "Show a timer when Golden Ghoul, Old Wolf, Voidling Extremist or Millenia-Aged Blaze respawns. " + - "§cSometimes it takes 20-30 seconds to calibrate correctly." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean areaBossRespawnTimer = false; - - @Expose - @ConfigOption(name = "Enderman TP Hider", desc = "Stops the Enderman Teleportation animation.") - @ConfigEditorBoolean - @FeatureToggle - public boolean endermanTeleportationHider = true; - - @Expose - @ConfigOption(name = "Arachne Minis Hider", desc = "Hides the nametag above arachne minis.") - @ConfigEditorBoolean - @FeatureToggle - public boolean hideNameTagArachneMinis = true; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/SummoningsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/SummoningsConfig.java deleted file mode 100644 index c7ebef451..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/SummoningsConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -package at.hannibal2.skyhanni.config.features; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigOption; - -public class SummoningsConfig { - - @Expose - @ConfigOption(name = "Summoning Soul Display", desc = "Show the name of dropped Summoning Souls laying on the ground. " + - "§cNot working in dungeons if Skytils' 'Hide Non-Starred Mobs Nametags' feature is enabled!") - @ConfigEditorBoolean - @FeatureToggle - public boolean summoningSoulDisplay = false; - - @Expose - @ConfigOption(name = "Summoning Mob", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean summoningMob = false; - - @Expose - @ConfigOption(name = "Summoning Mob Display", desc = "Show the health of your spawned summons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean summoningMobDisplay = false; - - @Expose - public Position summoningMobDisplayPos = new Position(10, 10, false, true); - - @Expose - @ConfigOption(name = "Summoning Mob Nametag", desc = "Hide the nametag of your spawned summons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean summoningMobHideNametag = false; - - @Expose - @ConfigOption(name = "Summoning Mob Color", desc = "Marks own summons green.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean summoningMobColored = false; -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt index ab4d22df1..0d164b477 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.util.EnumParticleTypes @@ -16,7 +17,7 @@ class MiscFeatures { @SubscribeEvent fun onEnderTeleport(event: EnderTeleportEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.mobs.endermanTeleportationHider) return + if (!SkyHanniMod.feature.combat.mobs.endermanTeleportationHider) return event.isCanceled = true } @@ -44,4 +45,9 @@ class MiscFeatures { event.isCanceled = true } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "mobs", "combat.mobs") + } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/mobs/AreaMiniBossFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/mobs/AreaMiniBossFeatures.kt index a0988ceac..10b77f526 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mobs/AreaMiniBossFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mobs/AreaMiniBossFeatures.kt @@ -17,6 +17,7 @@ import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class AreaMiniBossFeatures { + private val config get() = SkyHanniMod.feature.combat.mobs private var lastTime = 0L private var miniBossType: AreaMiniBossType? = null private var respawnCooldown = 11_000L @@ -39,11 +40,11 @@ class AreaMiniBossFeatures { } lastTime = time - if (SkyHanniMod.feature.mobs.areaBossHighlight) { + if (config.areaBossHighlight) { val color = bossType.color.toColor().withAlpha(bossType.colorOpacity) RenderLivingEntityHelper.setEntityColor(entity, color) - { SkyHanniMod.feature.mobs.areaBossHighlight } - RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.mobs.areaBossHighlight } + { config.areaBossHighlight } + RenderLivingEntityHelper.setNoHurtTime(entity) { config.areaBossHighlight } } // TODO add sound @@ -53,7 +54,7 @@ class AreaMiniBossFeatures { @SubscribeEvent fun onRenderWorld(event: RenderWorldLastEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.mobs.areaBossRespawnTimer) return + if (!config.areaBossRespawnTimer) return miniBossType?.apply { val time = getTime() diff --git a/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt b/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt index f3709b317..87d4e5a13 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mobs/AshfangMinisNametagHider.kt @@ -9,11 +9,12 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class AshfangMinisNametagHider { + private val config get() = SkyHanniMod.feature.combat.mobs @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.mobs.hideNameTagArachneMinis) return + if (!config.hideNameTagArachneMinis) return val entity = event.entity if (entity !is EntityArmorStand) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt index 8d8a3ca40..a366f5ce5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt @@ -11,13 +11,13 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.entity.EntityLivingBase +import net.minecraft.entity.monster.EntityCaveSpider import net.minecraft.entity.monster.EntityEnderman import net.minecraft.entity.monster.EntitySpider -import net.minecraft.entity.monster.EntityCaveSpider import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class MobHighlight { - private val config get() = SkyHanniMod.feature.mobs + private val config get() = SkyHanniMod.feature.combat.mobs @SubscribeEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt index 63df99ab0..dc3533cd2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.summonings import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth @@ -14,6 +15,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SummoningMobManager { + private val config get() = SkyHanniMod.feature.combat.summonings private val summoningMobs = mutableMapOf<EntityLiving, SummoningMob>() @@ -38,7 +40,7 @@ class SummoningMobManager { val message = event.message spawnPatter.matchMatcher(message) { - if (SkyHanniMod.feature.summonings.summoningMobDisplay) { + if (config.summoningMobDisplay) { event.blockedReason = "summoning_soul" } summoningsSpawned++ @@ -48,13 +50,13 @@ class SummoningMobManager { if (despawnPatter.matcher(message).matches() || message.startsWith("§c ☠ §r§7You ")) { despawned() - if (SkyHanniMod.feature.summonings.summoningMobDisplay && !message.contains("☠")) { + if (config.summoningMobDisplay && !message.contains("☠")) { event.blockedReason = "summoning_soul" } } if (message == "§cThe Seraph recalled your summoned ally!" || seraphRecallPattern.matcher(message).matches()) { despawned() - if (SkyHanniMod.feature.summonings.summoningMobDisplay) { + if (config.summoningMobDisplay) { event.blockedReason = "summoning_soul" } } @@ -64,7 +66,7 @@ class SummoningMobManager { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - if (SkyHanniMod.feature.summonings.summoningMobDisplay) { + if (config.summoningMobDisplay) { if (event.repeatSeconds(1)) { updateData() } @@ -128,7 +130,7 @@ class SummoningMobManager { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.summonings.summoningMobDisplay) return + if (!config.summoningMobDisplay) return if (summoningMobs.isEmpty()) return val list = mutableListOf<String>() @@ -140,7 +142,7 @@ class SummoningMobManager { id++ } - SkyHanniMod.feature.summonings.summoningMobDisplayPos.renderStrings(list, posLabel = "Summoning Mob Display") + config.summoningMobDisplayPos.renderStrings(list, posLabel = "Summoning Mob Display") } @SubscribeEvent @@ -151,7 +153,7 @@ class SummoningMobManager { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.summonings.summoningMobHideNametag) return + if (!config.summoningMobHideNametag) return val entity = event.entity if (entity !is EntityArmorStand) return @@ -163,7 +165,7 @@ class SummoningMobManager { @SubscribeEvent fun onRenderMobColored(event: RenderMobColoredEvent) { - if (SkyHanniMod.feature.summonings.summoningMobColored) { + if (config.summoningMobColored) { val entity = event.entity if (entity is EntityLiving && entity in summoningMobs.keys) { event.color = LorenzColor.GREEN.toColor().withAlpha(127) @@ -174,11 +176,16 @@ class SummoningMobManager { @SubscribeEvent fun onResetEntityHurtTime(event: ResetEntityHurtEvent) { val entity = event.entity - if (SkyHanniMod.feature.summonings.summoningMobColored && entity in summoningMobs.keys) { + if (config.summoningMobColored && entity in summoningMobs.keys) { event.shouldReset = true } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "summonings", "combat.summonings") + } + private fun despawned() { summoningMobs.clear() summoningMobNametags.clear() @@ -188,7 +195,7 @@ class SummoningMobManager { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyBlock && (SkyHanniMod.feature.summonings.summoningMobDisplay || SkyHanniMod.feature.summonings.summoningMobHideNametag) + return LorenzUtils.inSkyBlock && (config.summoningMobDisplay || config.summoningMobHideNametag) } class SummoningMob( diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt index 5bf3b1a3d..709d5e662 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -92,7 +92,5 @@ class SummoningSoulsName { mobsName.clear() } - private fun isEnabled(): Boolean { - return LorenzUtils.inSkyBlock && SkyHanniMod.feature.summonings.summoningSoulDisplay - } + private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.combat.summonings.summoningSoulDisplay }
\ No newline at end of file |