mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Print help on invalid arg
This commit is contained in:
parent
8812e1b60c
commit
1071e7c226
@ -107,6 +107,7 @@ import com.sk89q.worldedit.command.argument.ZonedDateTimeConverter;
|
|||||||
import com.sk89q.worldedit.command.util.CommandPermissions;
|
import com.sk89q.worldedit.command.util.CommandPermissions;
|
||||||
import com.sk89q.worldedit.command.util.CommandQueuedCondition;
|
import com.sk89q.worldedit.command.util.CommandQueuedCondition;
|
||||||
import com.sk89q.worldedit.command.util.PermissionCondition;
|
import com.sk89q.worldedit.command.util.PermissionCondition;
|
||||||
|
import com.sk89q.worldedit.command.util.PrintCommandHelp;
|
||||||
import com.sk89q.worldedit.command.util.SubCommandPermissionCondition;
|
import com.sk89q.worldedit.command.util.SubCommandPermissionCondition;
|
||||||
import com.sk89q.worldedit.entity.Entity;
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
import com.sk89q.worldedit.entity.Player;
|
import com.sk89q.worldedit.entity.Player;
|
||||||
@ -704,7 +705,6 @@ public final class PlatformCommandManager {
|
|||||||
exceptionConverter.convert(next);
|
exceptionConverter.convert(next);
|
||||||
next = next.getCause();
|
next = next.getCause();
|
||||||
} while (next != null);
|
} while (next != null);
|
||||||
|
|
||||||
throw t;
|
throw t;
|
||||||
}
|
}
|
||||||
} catch (ConditionFailedException e) {
|
} catch (ConditionFailedException e) {
|
||||||
@ -734,6 +734,8 @@ public final class PlatformCommandManager {
|
|||||||
.color(TextColor.RED)
|
.color(TextColor.RED)
|
||||||
.append(e.getRichMessage())
|
.append(e.getRichMessage())
|
||||||
.build());
|
.build());
|
||||||
|
List<String> argList = parseArgs(event.getArguments()).map(Substring::getSubstring).collect(Collectors.toList());
|
||||||
|
printUsage(actor, argList);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
handleUnknownException(actor, t);
|
handleUnknownException(actor, t);
|
||||||
} finally {
|
} finally {
|
||||||
@ -775,6 +777,11 @@ public final class PlatformCommandManager {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void printUsage(Actor actor, List<String> arguments) {
|
||||||
|
PrintCommandHelp.help(arguments, 0, false,
|
||||||
|
getCommandManager(), actor, "//help");
|
||||||
|
}
|
||||||
|
|
||||||
private MemoizingValueAccess initializeInjectedValues(Arguments arguments, Actor tmp) {
|
private MemoizingValueAccess initializeInjectedValues(Arguments arguments, Actor tmp) {
|
||||||
InjectedValueStore store = MapBackedValueStore.create();
|
InjectedValueStore store = MapBackedValueStore.create();
|
||||||
Actor actor = wrapActor(tmp, store);
|
Actor actor = wrapActor(tmp, store);
|
||||||
|
Loading…
Reference in New Issue
Block a user