diff options
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)) { |