diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-10-03 00:28:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-03 00:28:26 +0200 |
commit | e468384b34a5e1af56921149d1a05976e4eadd6a (patch) | |
tree | aa0425552f3cda5aae2233da8089bd944d50ace9 /src/main/java/at/hannibal2/skyhanni/test | |
parent | c33c011a3314ee533b998da78851e7777338c727 (diff) | |
download | skyhanni-e468384b34a5e1af56921149d1a05976e4eadd6a.tar.gz skyhanni-e468384b34a5e1af56921149d1a05976e4eadd6a.tar.bz2 skyhanni-e468384b34a5e1af56921149d1a05976e4eadd6a.zip |
Fix: Preconditions to debug commands (#2641)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Co-authored-by: CalMWolfs <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/command/TrackParticlesCommand.kt | 7 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/command/TrackSoundsCommand.kt | 7 |
2 files changed, 14 insertions, 0 deletions
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<Renderable> = emptyList() private var worldParticles: Map<LorenzVec, List<ReceiveParticleEvent>> = emptyMap() + // TODO write abstract code for this and TrackSoundsCommand fun command(args: Array<String>) { + 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<Renderable> = emptyList() private var worldSounds: Map<LorenzVec, List<PlaySoundEvent>> = emptyMap() + // TODO write abstract code for this and TrackParticlesCommand fun command(args: Array<String>) { + if (!LorenzUtils.inSkyBlock) { + ChatUtils.userError("This command only works in SkyBlock!") + return + } + if (args.firstOrNull() == "end") { if (!isRecording) { ChatUtils.userError("Nothing to end") |