diff options
author | Walker Selby <git@walkerselby.com> | 2023-10-11 11:24:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 12:24:39 +0200 |
commit | 4f9fe89aac7b97741f7079ab1ad5f7051e0fa7f7 (patch) | |
tree | 80d0ba5a1fa2893c0529f0382a99d6a044bc905c /src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt | |
parent | 8527d7555ea16becbcfe949413eabfd41c8400c4 (diff) | |
download | skyhanni-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.kt | 19 |
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)) { |