aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-16 13:20:59 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-16 13:20:59 +0200
commitb155103abb08a9d54d91cc1d141bce8994f69a89 (patch)
treea7510777c4c4c51acdeacd1b3f0b48079f1f3e71 /src/main/java/at/hannibal2/skyhanni/features
parent83b5cd3c93bab32f16365c6b6810362f4de5598e (diff)
downloadskyhanni-b155103abb08a9d54d91cc1d141bce8994f69a89.tar.gz
skyhanni-b155103abb08a9d54d91cc1d141bce8994f69a89.tar.bz2
skyhanni-b155103abb08a9d54d91cc1d141bce8994f69a89.zip
use config migration on ashfang gravity orbs
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt14
2 files changed, 17 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
index 7a993f0de..ff45b6bba 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.garden.farming
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.*
@@ -73,6 +74,11 @@ class FarmingWeightDisplay {
}
}
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(1, "garden.eliteFarmingWeightoffScreenDropMessage", "garden.eliteFarmingWeightOffScreenDropMessage")
+ }
+
companion object {
private val config get() = SkyHanniMod.feature.garden
private val localCounter = mutableMapOf<CropType, Long>()
@@ -285,7 +291,7 @@ class FarmingWeightDisplay {
SkyHanniMod.coroutineScope.launch {
val wasNotLoaded = leaderboardPosition == -1
leaderboardPosition = loadLeaderboardPosition()
- if (wasNotLoaded && config.eliteFarmingWeightoffScreenDropMessage) {
+ if (wasNotLoaded && config.eliteFarmingWeightOffScreenDropMessage) {
checkOffScreenLeaderboardChanges()
}
ProfileStorageData.profileSpecific?.garden?.farmingWeight?.lastFarmingWeightLeaderboard =
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
index 92b699845..b9d6e6b7e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.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.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.features.damageindicator.BossType
@@ -14,6 +15,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color
class AshfangGravityOrbs {
+ private val config get() = SkyHanniMod.feature.ashfang.gravityOrbs
private val texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV" +
"0L3RleHR1cmUvMWE2OWNjZjdhZDkwNGM5YTg1MmVhMmZmM2Y1YjRlMjNhZGViZjcyZWQxMmQ1ZjI0Yjc4Y2UyZDQ0YjRhMiJ9fX0="
@@ -32,7 +34,7 @@ class AshfangGravityOrbs {
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!isEnabled()) return
- val color = Color(SpecialColour.specialToChromaRGB(SkyHanniMod.feature.ashfang.gravityOrbsColor), true)
+ val color = Color(SpecialColour.specialToChromaRGB(config.color), true)
val playerLocation = LocationUtils.playerLocation()
for (orb in orbs) {
if (orb.isDead) continue
@@ -52,8 +54,12 @@ class AshfangGravityOrbs {
orbs.clear()
}
- private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyBlock && SkyHanniMod.feature.ashfang.gravityOrbs &&
- DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(1, "ashfang.gravityOrbs", "ashfang.gravityOrbs.enabled")
+ event.move(1, "ashfang.gravityOrbsColor", "ashfang.gravityOrbs.color")
}
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled &&
+ DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
} \ No newline at end of file