diff options
author | Linnea Gräf <nea@nea.moe> | 2024-02-26 15:35:39 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-02-26 15:37:19 +0100 |
commit | 6eb8fd4d3c5f7e327a6b5691edfc5ac22888c1a4 (patch) | |
tree | 33056bbf6c74d8ac0b9ed453e546c9ada9fb1c22 /src/main/kotlin | |
parent | 602112724d8236c1ec6671e1893128862c9f5815 (diff) | |
download | Firmament-6eb8fd4d3c5f7e327a6b5691edfc5ac22888c1a4.tar.gz Firmament-6eb8fd4d3c5f7e327a6b5691edfc5ac22888c1a4.tar.bz2 Firmament-6eb8fd4d3c5f7e327a6b5691edfc5ac22888c1a4.zip |
Fix ancestral spade solver being visible outside hub
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt b/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt index 442d8cf..cd399b3 100644 --- a/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt +++ b/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt @@ -16,6 +16,7 @@ import moe.nea.firmament.events.SoundReceiveEvent import moe.nea.firmament.events.WorldKeyboardEvent import moe.nea.firmament.events.WorldReadyEvent import moe.nea.firmament.events.WorldRenderLastEvent +import moe.nea.firmament.util.SBData import moe.nea.firmament.util.TimeMark import moe.nea.firmament.util.WarpUtil import moe.nea.firmament.util.render.RenderInWorldContext @@ -30,8 +31,10 @@ object AncestralSpadeSolver { private var lastTeleportAttempt = TimeMark.farPast() + fun isEnabled() = + DianaWaypoints.TConfig.ancestralSpadeSolver && SBData.skyblockLocation == "hub" fun onKeyBind(event: WorldKeyboardEvent) { - if (!DianaWaypoints.TConfig.ancestralSpadeSolver) return + if (!isEnabled()) return if (!event.matches(DianaWaypoints.TConfig.ancestralSpadeTeleport)) return if (lastTeleportAttempt.passedTime() < 3.seconds) return @@ -40,7 +43,7 @@ object AncestralSpadeSolver { } fun onParticleSpawn(event: ParticleSpawnEvent) { - if (!DianaWaypoints.TConfig.ancestralSpadeSolver) return + if (!isEnabled()) return if (event.particleEffect != ParticleTypes.DRIPPING_LAVA) return if (event.offset.x != 0.0F || event.offset.y != 0F || event.offset.z != 0F) return @@ -51,7 +54,7 @@ object AncestralSpadeSolver { } fun onPlaySound(event: SoundReceiveEvent) { - if (!DianaWaypoints.TConfig.ancestralSpadeSolver) return + if (!isEnabled()) return if (!SoundEvents.BLOCK_NOTE_BLOCK_HARP.matchesId(event.sound.value().id)) return if (lastDing.passedTime() > 1.seconds) { @@ -90,7 +93,7 @@ object AncestralSpadeSolver { } fun onWorldRender(event: WorldRenderLastEvent) { - if (!DianaWaypoints.TConfig.ancestralSpadeSolver) return + if (!isEnabled()) return RenderInWorldContext.renderInWorld(event) { nextGuess?.let { color(1f, 1f, 0f, 0.5f) |