Skip to content

Commit 9c03ab7

Browse files
committed
fabric: only strip the starting '/' from input when it is actually there
1 parent 33cbc87 commit 9c03ab7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cloud-minecraft/cloud-fabric/src/main/java/cloud/commandframework/fabric/FabricExecutor.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ final class FabricExecutor<C, S extends CommandSource> implements Command<S> {
7979
@Override
8080
public int run(final @NonNull CommandContext<S> ctx) {
8181
final S source = ctx.getSource();
82-
final String input = ctx.getInput().substring(1);
82+
final String input = ctx.getInput().startsWith("/")
83+
? ctx.getInput().substring(1)
84+
: ctx.getInput();
8385
final C sender = this.manager.getCommandSourceMapper().apply(source);
8486
this.manager.executeCommand(sender, input).whenComplete(this.getResultConsumer(source, sender));
8587
return com.mojang.brigadier.Command.SINGLE_SUCCESS;

0 commit comments

Comments
 (0)