S
- sender typepublic abstract class AbstractCommandManager<S> extends Object implements CommandManager<S>
CommandManager
Modifier and Type | Field and Description |
---|---|
protected List<RegisteredCommand<S>> |
registeredCommands |
protected boolean |
shouldFallback |
Constructor and Description |
---|
AbstractCommandManager() |
Modifier and Type | Method and Description |
---|---|
@NotNull List<RegisteredCommand<S>> |
getRegisteredCommands()
Returns unmodifiable copy of the commands, registered and held by this command manager.
|
protected abstract void |
handleRegistration(RegisteredCommand<S> command) |
void |
register(@NotNull Command<S> command,
@Nullable Predicate<S> permissionCheck,
String... aliases)
Registers the specified command with the identifying aliases, giving option to check for
permissions.
|
void |
setShouldFallback(boolean shouldFallback) |
boolean |
shouldFallback()
Returns whether or not this command manager should fallback to the implemented on platform's
normal registering technique when brigadier isn't supported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aliasesFree, getAliases, isBrigadierSupported, register
protected List<RegisteredCommand<S>> registeredCommands
protected boolean shouldFallback
public AbstractCommandManager()
public void register(@NotNull @NotNull Command<S> command, @Nullable @Nullable Predicate<S> permissionCheck, @NotNull String... aliases)
CommandManager
register
in interface CommandManager<S>
command
- the command you want to registerpermissionCheck
- permission checkaliases
- aliasesprotected abstract void handleRegistration(RegisteredCommand<S> command)
public boolean shouldFallback()
CommandManager
shouldFallback
in interface CommandManager<S>
true
if should fallback, false
otherwisepublic void setShouldFallback(boolean shouldFallback)
setShouldFallback
in interface CommandManager<S>
shouldFallback
- valueCommandManager.shouldFallback()
@NotNull public @NotNull List<RegisteredCommand<S>> getRegisteredCommands()
CommandManager
getRegisteredCommands
in interface CommandManager<S>
Copyright © 2020. All rights reserved.