fabric: only strip the starting '/' from input when it is actually there
This commit is contained in:
parent
96e08ab2ef
commit
653503f375
1 changed files with 3 additions and 1 deletions
|
|
@ -79,7 +79,9 @@ final class FabricExecutor<C, S extends CommandSource> implements Command<S> {
|
||||||
@Override
|
@Override
|
||||||
public int run(final @NonNull CommandContext<S> ctx) {
|
public int run(final @NonNull CommandContext<S> ctx) {
|
||||||
final S source = ctx.getSource();
|
final S source = ctx.getSource();
|
||||||
final String input = ctx.getInput().substring(1);
|
final String input = ctx.getInput().startsWith("/")
|
||||||
|
? ctx.getInput().substring(1)
|
||||||
|
: ctx.getInput();
|
||||||
final C sender = this.manager.getCommandSourceMapper().apply(source);
|
final C sender = this.manager.getCommandSourceMapper().apply(source);
|
||||||
this.manager.executeCommand(sender, input).whenComplete(this.getResultConsumer(source, sender));
|
this.manager.executeCommand(sender, input).whenComplete(this.getResultConsumer(source, sender));
|
||||||
return com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
return com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue