From 4c2608d8aa3c43a01b83192141f7ce2cfbc78a11 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sat, 9 Dec 2023 12:04:51 +0100 Subject: Fixed resetCommand error message (#779) Fixed error message in "/shconfig" command. #779 --- .../hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2') 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'" } } -- cgit