Class BukkitCommandManager
java.lang.Object
io.github.projectunified.craftcommand.CommandManager<org.bukkit.command.CommandSender>
io.github.projectunified.craftcommand.bukkit.BukkitCommandManager
CommandManager implementation for Bukkit plugins.
Handles command registration to the Bukkit CommandMap, syncing commands, and default Bukkit type resolvers (Player, World, Location, etc.).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets all registered Bukkit commands as an unmodifiable map.voidRegisters a command.voidregister(org.bukkit.command.Command command) Registers a Bukkit Command object to the server's command map.protected voidsendMessage(org.bukkit.command.CommandSender sender, String message) Sends an already formatted message.voidSynchronizes commands to the client (calls Server#syncCommands if available).voidUnregisters all commands registered by this command manager.Methods inherited from class io.github.projectunified.craftcommand.CommandManager
filterSuggestions, formatMessage, getCommandInfo, getResolver, handleException, instantiateWrapper, registerProvider, registerResolver, registerSenderResolver, registerWrapper, resolveParameter, resolveSender, sendMessage
-
Constructor Details
-
BukkitCommandManager
public BukkitCommandManager(org.bukkit.plugin.java.JavaPlugin plugin)
-
-
Method Details
-
sendMessage
Description copied from class:CommandManagerSends an already formatted message. Implemented by each platform manager.- Specified by:
sendMessagein classCommandManager<org.bukkit.command.CommandSender>- Parameters:
sender- the message recipientmessage- the formatted message
-
syncCommand
public void syncCommand()Synchronizes commands to the client (calls Server#syncCommands if available). -
register
public void register(org.bukkit.command.Command command) Registers a Bukkit Command object to the server's command map.- Parameters:
command- the command object
-
unregisterAll
public void unregisterAll()Unregisters all commands registered by this command manager. -
getRegisteredCommands
Gets all registered Bukkit commands as an unmodifiable map.- Returns:
- an unmodifiable map of command labels to Command objects
-
register
Description copied from class:CommandManagerRegisters a command.- Specified by:
registerin classCommandManager<org.bukkit.command.CommandSender>
-