aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-16 20:15:49 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-16 20:15:49 +0200
commit8a24244b8e19830b074b8bc739abd1cc8c70fe98 (patch)
tree406adcb61e6ced62210dca475fcb94e29c81e045
parent3a05fb32e00dad96dd3ae1d186c9375aa0d477cd (diff)
downloadskyhanni-8a24244b8e19830b074b8bc739abd1cc8c70fe98.tar.gz
skyhanni-8a24244b8e19830b074b8bc739abd1cc8c70fe98.tar.bz2
skyhanni-8a24244b8e19830b074b8bc739abd1cc8c70fe98.zip
migrate remaining ashfang config into crimson isle
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java52
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java51
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt13
8 files changed, 100 insertions, 69 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java
index cd6c14488..34e8d76a1 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Features.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java
@@ -68,10 +68,6 @@ public class Features extends Config {
public SummoningsConfig summonings = new SummoningsConfig();
@Expose
- @Category(name = "Ashfang", desc = "Ashfang fight in Crimson Isle.")
- public AshfangConfig ashfang = new AshfangConfig();
-
- @Expose
@Category(name = "Crimson Isle", desc = "Things to do on the Crimson Isle/Nether island.")
public CrimsonIsleConfig crimsonIsle = new CrimsonIsleConfig();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java
deleted file mode 100644
index 99edc22e2..000000000
--- a/src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java
+++ /dev/null
@@ -1,52 +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.ConfigEditorBoolean;
-import io.github.moulberry.moulconfig.annotations.ConfigOption;
-
-public class AshfangConfig {
-
- @Expose
- @ConfigOption(name = "Freeze", desc = "Show the cooldown for how long Ashfang blocks your abilities.")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean freezeCooldown = false;
-
- @Expose
- public Position freezeCooldownPos = new Position(10, 10, false, true);
-
- @Expose
- @ConfigOption(name = "Reset Time", desc = "Show the cooldown until Ashfang pulls his underlings back.")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean nextResetCooldown = false;
-
- @Expose
- public Position nextResetCooldownPos = new Position(10, 10, false, true);
-
- @Expose
- @ConfigOption(name = "Highlight Blazes", desc = "Highlight the different blazes in their respective colors.")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean highlightBlazes = false;
-
- @Expose
- @ConfigOption(name = "Hide Particles", desc = "Hide particles around the Ashfang boss.")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean hideParticles = false;
-
- @Expose
- @ConfigOption(name = "Hide Names", desc = "Hide the names of full health blazes around Ashfang (only useful when highlight blazes is enabled)")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean hideNames = false;
-
- @Expose
- @ConfigOption(name = "Hide Damage", desc = "Hide damage splashes around Ashfang.")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean hideDamageSplash = false;
-}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java
index 70167e5a6..3826f87b0 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java
@@ -1,6 +1,7 @@
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.Accordion;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
@@ -53,5 +54,55 @@ public class CrimsonIsleConfig {
@ConfigEditorColour
public String color = "0:245:85:255:85";
}
+
+ @ConfigOption(name = "Hide Stuff", desc = "")
+ @Accordion
+ @Expose
+ public HideAshfangConfig hide = new HideAshfangConfig();
+
+ public static class HideAshfangConfig {
+
+ @Expose
+ @ConfigOption(name = "Hide Particles", desc = "Hide particles around the Ashfang boss.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean particles = false;
+
+ @Expose
+ @ConfigOption(name = "Hide Full Names", desc = "Hide the names of full health blazes around Ashfang (only useful when highlight blazes is enabled)")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean fullNames = false;
+
+ @Expose
+ @ConfigOption(name = "Hide Damage Splash", desc = "Hide damage splashes around Ashfang.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean damageSplash = false;
+ }
+
+ @Expose
+ @ConfigOption(name = "Highlight Blazes", desc = "Highlight the different blazes in their respective colors.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean highlightBlazes = false;
+
+ @Expose
+ @ConfigOption(name = "Freeze Cooldown", desc = "Show the cooldown for how long Ashfang blocks your abilities.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean freezeCooldown = false;
+
+ @Expose
+ public Position freezeCooldownPos = new Position(10, 10, false, true);
+
+ @Expose
+ @ConfigOption(name = "Reset Time", desc = "Show the cooldown until Ashfang pulls his underlings back.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean nextResetCooldown = false;
+
+ @Expose
+ public Position nextResetCooldownPos = new Position(10, 10, false, true);
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
index e6d57a184..1375dad47 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.*
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
@@ -16,6 +17,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class AshfangBlazes {
+ private val config get() = SkyHanniMod.feature.crimsonIsle.ashfang
private val blazeColor = mutableMapOf<EntityBlaze, LorenzColor>()
private val blazeArmorStand = mutableMapOf<EntityBlaze, EntityArmorStand>()
@@ -73,7 +75,7 @@ class AshfangBlazes {
@SubscribeEvent
fun onRenderMobColored(event: RenderMobColoredEvent) {
if (!isEnabled()) return
- if (!SkyHanniMod.feature.ashfang.highlightBlazes) return
+ if (!config.highlightBlazes) return
val entity = event.entity
event.color = blazeColor[entity]?.toColor()?.withAlpha(40) ?: 0
}
@@ -81,7 +83,7 @@ class AshfangBlazes {
@SubscribeEvent
fun onResetEntityHurtTime(event: ResetEntityHurtEvent) {
if (!isEnabled()) return
- if (!SkyHanniMod.feature.ashfang.highlightBlazes) return
+ if (!config.highlightBlazes) return
val entity = event.entity
if (entity in blazeColor) {
event.shouldReset = true
@@ -91,7 +93,7 @@ class AshfangBlazes {
@SubscribeEvent(priority = EventPriority.HIGH)
fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
if (!isEnabled()) return
- if (!SkyHanniMod.feature.ashfang.hideNames) return
+ if (!config.hide.fullNames) return
val entity = event.entity
if (entity !is EntityArmorStand) return
@@ -108,6 +110,13 @@ class AshfangBlazes {
blazeArmorStand.clear()
}
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(2, "ashfang.nextResetCooldown", "crimsonIsle.ashfang.nextResetCooldown")
+ event.move(2, "ashfang.highlightBlazes", "crimsonIsle.ashfang.highlightBlazes")
+ event.move(2, "ashfang.hideNames", "crimsonIsle.ashfang.hide.fullNames")
+ }
+
private fun isEnabled(): Boolean {
return LorenzUtils.inSkyBlock && DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
}
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 bb766f36c..70514f8a2 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
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.damageindicator.BossType
@@ -12,8 +13,9 @@ import at.hannibal2.skyhanni.utils.TimeUtils
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class AshfangFreezeCooldown {
+ private val config get() = SkyHanniMod.feature.crimsonIsle.ashfang
- var lastHit = 0L
+ private var lastHit = 0L
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
@@ -34,15 +36,21 @@ class AshfangFreezeCooldown {
val remainingLong = maxDuration - duration
if (remainingLong > 0) {
val format = TimeUtils.formatDuration(remainingLong, showMilliSeconds = true)
- SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString(
+ config.freezeCooldownPos.renderString(
"§cAshfang Freeze: §a$format",
posLabel = "Ashfang Freeze Cooldown"
)
}
}
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(2, "ashfang.freezeCooldown", "crimsonIsle.ashfang.freezeCooldown")
+ event.move(2, "ashfang.freezeCooldownPos", "crimsonIsle.ashfang.freezeCooldownPos")
+ }
+
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.freezeCooldown &&
+ return LorenzUtils.inSkyBlock && config.freezeCooldown &&
DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt
index 0eb6ac920..d40f3131e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideDamageIndicator.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -20,8 +21,12 @@ class AshfangHideDamageIndicator {
}
}
- private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.hideDamageSplash &&
- DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(2, "ashfang.hideDamageSplash", "crimsonIsle.ashfang.hide.damageSplash")
}
+
+ private fun isEnabled() =
+ LorenzUtils.inSkyBlock && SkyHanniMod.feature.crimsonIsle.ashfang.hide.damageSplash &&
+ DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
index 82d5113c4..f51ce004e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
@@ -48,5 +49,11 @@ class AshfangHideParticles {
}
}
- private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.hideParticles && nearAshfang
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(2, "ashfang.hideParticles", "crimsonIsle.ashfang.hide.particles")
+ }
+
+ private fun isEnabled() =
+ LorenzUtils.inSkyBlock && SkyHanniMod.feature.crimsonIsle.ashfang.hide.particles && nearAshfang
} \ 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 47eb05f18..0f51a37fb 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
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
@@ -15,7 +16,7 @@ import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class AshfangNextResetCooldown {
-
+ private val config get() = SkyHanniMod.feature.crimsonIsle.ashfang
private var spawnTime = 1L
@SubscribeEvent
@@ -37,7 +38,7 @@ class AshfangNextResetCooldown {
val remainingTime = spawnTime + 46_100 - System.currentTimeMillis()
if (remainingTime > 0) {
val format = TimeUtils.formatDuration(remainingTime, TimeUnit.SECOND, showMilliSeconds = true)
- SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString(
+ config.nextResetCooldownPos.renderString(
"§cAshfang next reset in: §a$format",
posLabel = "Ashfang Reset Cooldown"
)
@@ -51,8 +52,14 @@ class AshfangNextResetCooldown {
spawnTime = -1
}
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(2, "ashfang.nextResetCooldown", "crimsonIsle.ashfang.nextResetCooldown")
+ event.move(2, "ashfang.nextResetCooldownPos", "crimsonIsle.ashfang.nextResetCooldownPos")
+ }
+
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.nextResetCooldown &&
+ return LorenzUtils.inSkyBlock && config.nextResetCooldown &&
DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
}
} \ No newline at end of file