From e468384b34a5e1af56921149d1a05976e4eadd6a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 3 Oct 2024 00:28:26 +0200 Subject: Fix: Preconditions to debug commands (#2641) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: CalMWolfs --- .../at/hannibal2/skyhanni/test/command/TrackParticlesCommand.kt | 7 +++++++ .../java/at/hannibal2/skyhanni/test/command/TrackSoundsCommand.kt | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/test') diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TrackParticlesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TrackParticlesCommand.kt index 69c16daeb..a48294bd8 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/TrackParticlesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/TrackParticlesCommand.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NumberUtil.roundTo import at.hannibal2.skyhanni.utils.OSUtils @@ -35,7 +36,13 @@ object TrackParticlesCommand { private var display: List = emptyList() private var worldParticles: Map> = emptyMap() + // TODO write abstract code for this and TrackSoundsCommand fun command(args: Array) { + if (!LorenzUtils.inSkyBlock) { + ChatUtils.userError("This command only works in SkyBlock!") + return + } + if (args.firstOrNull() == "end") { if (!isRecording) { ChatUtils.userError("Nothing to end") diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TrackSoundsCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TrackSoundsCommand.kt index 1fadab62d..18cfcf786 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/TrackSoundsCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/TrackSoundsCommand.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.PlaySoundEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NumberUtil.roundTo import at.hannibal2.skyhanni.utils.OSUtils @@ -36,7 +37,13 @@ object TrackSoundsCommand { private var display: List = emptyList() private var worldSounds: Map> = emptyMap() + // TODO write abstract code for this and TrackParticlesCommand fun command(args: Array) { + if (!LorenzUtils.inSkyBlock) { + ChatUtils.userError("This command only works in SkyBlock!") + return + } + if (args.firstOrNull() == "end") { if (!isRecording) { ChatUtils.userError("Nothing to end") -- cgit