aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2023-12-09 12:04:51 +0100
committerGitHub <noreply@github.com>2023-12-09 12:04:51 +0100
commit4c2608d8aa3c43a01b83192141f7ce2cfbc78a11 (patch)
tree9b5b7c989fa0b52e5bd329c72f6993783000f801
parente3200d4540f33e4a52b17a05176238feff4e67c7 (diff)
downloadskyhanni-4c2608d8aa3c43a01b83192141f7ce2cfbc78a11.tar.gz
skyhanni-4c2608d8aa3c43a01b83192141f7ce2cfbc78a11.tar.bz2
skyhanni-4c2608d8aa3c43a01b83192141f7ce2cfbc78a11.zip
Fixed resetCommand error message (#779)
Fixed error message in "/shconfig" command. #779
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
index 6f1bc9f64..4332a495a 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt
@@ -48,7 +48,7 @@ object SkyHanniConfigSearchResetCommand {
if (term.startsWith("playerSpecific")) return "§cCannot reset playerSpecific! Use §e/shconfig set §cinstead."
if (term.startsWith("profileSpecific")) return "§cCannot reset profileSpecific! Use §e/shconfig set §cinstead."
- return try {
+ try {
val (field, defaultObject, _) = getComplexField(term, Features())
val (_, _, parent) = getComplexField(term, SkyHanniMod.feature)
val affectedElements = findConfigElements({ it.startsWith("$term.") }, { true }).size
@@ -56,10 +56,10 @@ object SkyHanniConfigSearchResetCommand {
return "§cThis will change $affectedElements config elements! Use the command again to confirm."
}
field.set(parent, defaultObject)
- "§eSuccessfully reset config element '$term'"
- } catch (e: Exception) {
+ return "§eSuccessfully reset config element '$term'"
+ } catch (e: Throwable) {
ErrorManager.logError(e, "Could not reset config element '$term'")
- "§cCould not reset config element '$term'"
+ return "§cCould not reset config element '$term'"
}
}