Fixed commands not working

This commit is contained in:
MattBDev 2020-02-06 15:34:22 -05:00
parent 490e200a70
commit 0b5eb903b6

View File

@ -616,7 +616,12 @@ public final class PlatformCommandManager {
public void handleCommand(CommandEvent event) {
Request.reset();
Actor actor = event.getActor();
String args = event.getArguments();
String args;
if (event.getArguments().length() > 1) {
args = event.getArguments().substring(1);
} else {
args = event.getArguments();
}
TaskManager.IMP.taskNow(() -> {
int space0 = args.indexOf(' ');
String arg0 = space0 == -1 ? args : args.substring(0, space0);
@ -689,11 +694,12 @@ public final class PlatformCommandManager {
exceptionConverter.convert(next);
next = next.getCause();
} while (next != null);
throw t;
}
} catch (ConditionFailedException e) {
if (e.getCondition() instanceof PermissionCondition) {
actor.printError(Caption.of("fawe.error.no.perm", StringMan.getString(((PermissionCondition) e.getCondition()).getPermissions())));
actor.printError(TranslatableComponent.of("worldedit.command.permissions"));
} else {
actor.print(e.getRichMessage());
}
@ -819,6 +825,7 @@ public final class PlatformCommandManager {
}
throw t;
}
event.setSuggestions(suggestions.stream()
.map(suggestion -> {
int noSlashLength = arguments.length() - 1;