mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Fixed commands not working
This commit is contained in:
parent
490e200a70
commit
0b5eb903b6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user