From 4c5636e6f74b23fc773eceb6588ae8b51ac2d4c5 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 29 Jul 2020 06:20:16 -0400 Subject: [PATCH] Lie about command invocation succeeding if there is a syntax error. See https://github.com/VelocityPowered/Velocity/issues/337#issuecomment-665568793 This will need an API change to resolve, but it's late right now. --- .../proxy/command/VelocityCommandManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java index fc6df6f5d..b8f511ea7 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java @@ -160,8 +160,11 @@ public class VelocityCommandManager implements CommandManager { CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownCommand()); if (isSyntaxError) { source.sendMessage(TextComponent.of(e.getMessage(), NamedTextColor.RED)); + // This is, of course, a lie, but the API will need to change... + return true; + } else { + return false; } - return false; } catch (final Throwable e) { // Ugly, ugly swallowing of everything Throwable, because plugins are naughty. throw new RuntimeException("Unable to invoke command " + cmdLine + " for " + source, e);