S
- sender typepublic interface CommandManager<S>
Modifier and Type | Method and Description |
---|---|
default boolean |
aliasesFree(@NotNull List<RegisteredCommand<S>> commands,
@NotNull String[] aliases)
Returns whenever the aliases are free in the specified command list.
|
static @NotNull String[] |
getAliases(@NotNull String fallbackPrefix,
String... aliases)
Creates the aliases with the fallback prefix bukkit is creating normally, returns all the
aliases with which command x would get registered on bukkit.
|
@NotNull List<RegisteredCommand<S>> |
getRegisteredCommands()
Returns unmodifiable copy of the commands, registered and held by this command manager.
|
boolean |
isBrigadierSupported()
Returns whether or not brigadier is supported for this command manager.
|
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.
|
default void |
register(@NotNull Command<S> command,
String... aliases)
Registers the specified command with the identifying aliases.
|
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.
|
default void register(@NotNull @NotNull Command<S> command, @NotNull String... aliases)
command
- the command you want to registeraliases
- aliasesvoid register(@NotNull @NotNull Command<S> command, @Nullable @Nullable Predicate<S> permissionCheck, @NotNull String... aliases)
command
- the command you want to registerpermissionCheck
- permission checkaliases
- aliasesboolean isBrigadierSupported()
true
if brigadier is supported, false
otherwiseboolean shouldFallback()
true
if should fallback, false
otherwisevoid setShouldFallback(boolean shouldFallback)
shouldFallback
- valueshouldFallback()
@NotNull @NotNull List<RegisteredCommand<S>> getRegisteredCommands()
default boolean aliasesFree(@NotNull @NotNull List<RegisteredCommand<S>> commands, @NotNull @NotNull String[] aliases)
commands
- commandsaliases
- aliasestrue
if aliases free, false
otherwise@NotNull static @NotNull String[] getAliases(@NotNull @NotNull String fallbackPrefix, @NotNull String... aliases)
fallbackPrefix
- prefixaliases
- normally specified aliasesCopyright © 2020. All rights reserved.