diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/cosmetics')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt index 482799d27..90ec54196 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.cosmetics import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -30,8 +31,7 @@ class ArrowTrail { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return val secondsAlive = config.secondsAlive.toDouble().toDuration(DurationUnit.SECONDS) val time = SimpleTimeMark.now() val deathTime = time.plus(secondsAlive) @@ -51,8 +51,7 @@ class ArrowTrail { @SubscribeEvent fun onWorldRender(event: LorenzRenderWorldEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return val color = if (config.handlePlayerArrowsDifferently) config.playerArrowColor else config.arrowColor val playerArrowColor = color.toChromaColor() listYourArrow.forEach { @@ -66,6 +65,8 @@ class ArrowTrail { } } + private fun isEnabled() = config.enabled && (LorenzUtils.inSkyBlock || OutsideSbFeature.ARROW_TRAIL.isSelected()) + @SubscribeEvent fun onIslandChange(event: IslandChangeEvent) { listAllArrow.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt index 7f617fc64..1515e9a11 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.cosmetics import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -35,8 +36,7 @@ class CosmeticFollowingLine { @SubscribeEvent fun onRenderWorld(event: LorenzRenderWorldEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return updateClose(event) @@ -99,8 +99,7 @@ class CosmeticFollowingLine { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return if (event.isMod(5)) { locations = locations.editCopy { values.removeIf { it.time.passedSince() > config.secondsAlive.seconds } } @@ -124,6 +123,8 @@ class CosmeticFollowingLine { } } + private fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.FOLLOWING_LINE.isSelected()) && config.enabled + @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "misc.cosmeticConfig", "misc.cosmetic") |