From e9adf0f30d8d29b938b7e4bbc1653c6013ef8500 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 20 Sep 2021 23:35:04 +0100 Subject: [PATCH] Slightly preferable messages on UsageException thrown by piston --- .../extension/platform/PlatformCommandManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java index 63e51617b..23a777cd3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java @@ -766,13 +766,18 @@ public final class PlatformCommandManager { actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", e.getComponent())); } catch (UsageException e) { ImmutableList cmd = e.getCommands(); - if (!cmd.isEmpty()) { + if (e.getRichMessage() == TextComponent.empty() && !cmd.isEmpty()) { actor.print(Caption.of( "fawe.error.command.syntax", HelpGenerator.create(e.getCommandParseResult()).getFullHelp() )); + } else { + actor.print(Caption.of( + "fawe.error.command.syntax", + HelpGenerator.create(e.getCommandParseResult()).getUsage() + )); + actor.printError(e.getRichMessage()); } - actor.printError(e.getRichMessage()); } catch (CommandExecutionException e) { handleUnknownException(actor, e.getCause()); } catch (CommandException e) {