Skip to content

Commit

Permalink
Fix: Extension command arg parsing (GeyserMC#5081)
Browse files Browse the repository at this point in the history
* Fix: No args being parsed as 1 arg, and don't try to localize extension command's descriptions

* add comment
  • Loading branch information
onebeastchris authored Oct 12, 2024
1 parent 50de9d6 commit d64c0b3
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
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;
Expand Down Expand Up @@ -193,11 +194,17 @@ public void register(CommandManager<GeyserCommandSource> manager) {
.handler(this::execute));
}

@Override
protected org.incendo.cloud.Command.Builder.Applicable<GeyserCommandSource> 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<GeyserCommandSource> 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);
Expand Down

0 comments on commit d64c0b3

Please sign in to comment.