Package me.hsgamer.hscore.bukkit.command
Class CommandManager
java.lang.Object
me.hsgamer.hscore.bukkit.command.CommandManager
The command manager
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommandManager(@NotNull org.bukkit.plugin.java.JavaPlugin plugin) Create a new command manager -
Method Summary
Modifier and TypeMethodDescriptionGet registered commandsfinal voidregister(@NotNull org.bukkit.command.Command command) Register the commandstatic voidregisterCommandToCommandMap(@NotNull String label, @NotNull org.bukkit.command.Command command) Register the command to the command mapstatic voidSync the commands to the server.final voidunregister(@NotNull String command) Unregister the commandfinal voidunregister(@NotNull org.bukkit.command.Command command) Unregister the commandfinal voidUnregister all commandsstatic voidunregisterFromKnownCommands(@NotNull org.bukkit.command.Command command) Unregister a command from the known commands
-
Field Details
-
plugin
protected final org.bukkit.plugin.java.JavaPlugin plugin
-
-
Constructor Details
-
CommandManager
public CommandManager(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin) Create a new command manager- Parameters:
plugin- the plugin
-
-
Method Details
-
syncCommand
public static void syncCommand()Sync the commands to the server. Mainly used to make tab completer work in 1.13+ -
unregisterFromKnownCommands
public static void unregisterFromKnownCommands(@NotNull @NotNull org.bukkit.command.Command command) Unregister a command from the known commands- Parameters:
command- the command
-
registerCommandToCommandMap
public static void registerCommandToCommandMap(@NotNull @NotNull String label, @NotNull @NotNull org.bukkit.command.Command command) Register the command to the command map- Parameters:
label- the label of the commandcommand- the command
-
register
public final void register(@NotNull @NotNull org.bukkit.command.Command command) Register the command- Parameters:
command- the command object
-
unregister
public final void unregister(@NotNull @NotNull org.bukkit.command.Command command) Unregister the command- Parameters:
command- the command object
-
unregister
Unregister the command- Parameters:
command- the command label
-
unregisterAll
public final void unregisterAll()Unregister all commands -
getRegistered
Get registered commands- Returns:
- the map contains the name and the command object
-