aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-10-11 11:24:39 +0100
committerGitHub <noreply@github.com>2023-10-11 12:24:39 +0200
commit4f9fe89aac7b97741f7079ab1ad5f7051e0fa7f7 (patch)
tree80d0ba5a1fa2893c0529f0382a99d6a044bc905c /src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
parent8527d7555ea16becbcfe949413eabfd41c8400c4 (diff)
downloadskyhanni-4f9fe89aac7b97741f7079ab1ad5f7051e0fa7f7.tar.gz
skyhanni-4f9fe89aac7b97741f7079ab1ad5f7051e0fa7f7.tar.bz2
skyhanni-4f9fe89aac7b97741f7079ab1ad5f7051e0fa7f7.zip
More Code Cleanup - When (#531)
code cleanup #531
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
index 874697607..ab89d499d 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
@@ -82,13 +82,18 @@ object SkyHanniConfigSearchResetCommand {
rawJson = readFromClipboard
}
- val root: Any = if (term.startsWith("config")) {
- SkyHanniMod.feature
- } else if (term.startsWith("playerSpecific")) {
- ProfileStorageData.playerSpecific ?: return "§cplayerSpecific is null!"
- } else if (term.startsWith("profileSpecific")) {
- ProfileStorageData.profileSpecific ?: return "§cprofileSpecific is null!"
- } else return "§cUnknown config location!"
+ val root: Any = when {
+ term.startsWith("config") -> {
+ SkyHanniMod.feature
+ }
+ term.startsWith("playerSpecific") -> {
+ ProfileStorageData.playerSpecific ?: return "§cplayerSpecific is null!"
+ }
+ term.startsWith("profileSpecific") -> {
+ ProfileStorageData.profileSpecific ?: return "§cprofileSpecific is null!"
+ }
+ else -> return "§cUnknown config location!"
+ }
val affectedElements = findConfigElements({ it.startsWith("$term.") }, { true }).size
if (affectedElements > 3 && !args.contentEquals(lastCommand)) {