From d64c0b38dadb2d9d6c9712af18013af4daa056eb Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 13 Oct 2024 01:12:58 +0800 Subject: [PATCH] Fix: Extension command arg parsing (#5081) * Fix: No args being parsed as 1 arg, and don't try to localize extension command's descriptions * add comment --- .../geyser/extension/command/GeyserExtensionCommand.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/extension/command/GeyserExtensionCommand.java b/core/src/main/java/org/geysermc/geyser/extension/command/GeyserExtensionCommand.java index 0b22a8b8e..0dc49f5c1 100644 --- a/core/src/main/java/org/geysermc/geyser/extension/command/GeyserExtensionCommand.java +++ b/core/src/main/java/org/geysermc/geyser/extension/command/GeyserExtensionCommand.java @@ -38,6 +38,7 @@ import org.geysermc.geyser.command.GeyserCommandSource; import org.geysermc.geyser.session.GeyserSession; import org.incendo.cloud.CommandManager; import org.incendo.cloud.context.CommandContext; +import org.incendo.cloud.description.CommandDescription; import java.util.ArrayList; import java.util.List; @@ -193,11 +194,17 @@ public abstract class GeyserExtensionCommand extends GeyserCommand { .handler(this::execute)); } + @Override + protected org.incendo.cloud.Command.Builder.Applicable meta() { + // We don't want to localize the extension command description + return builder -> builder.commandDescription(CommandDescription.commandDescription(description)); + } + @SuppressWarnings("unchecked") @Override public void execute(CommandContext context) { GeyserCommandSource source = context.sender(); - String[] args = context.getOrDefault("args", "").split(" "); + String[] args = context.getOrDefault("args", " ").split(" "); if (sourceType.isInstance(source)) { executor.execute((T) source, this, args);