Package fr.maxlego08.menu.api.command
Interface CommandManager
- All Superinterfaces:
fr.maxlego08.menu.zcore.utils.storage.Savable
public interface CommandManager
extends fr.maxlego08.menu.zcore.utils.storage.Savable
Manages the registration, loading, and execution of commands associated with inventories.
-
Method Summary
Modifier and TypeMethodDescriptiongetCommand(Inventory inventory) Retrieves the command associated with a specific inventory.getCommand(String commandName) Retrieves the command associated with a specific name.Returns all registered commands.getCommands(org.bukkit.plugin.Plugin plugin) Returns the list of commands associated with a specific plugin.getPlayerArgument(UUID uuid, String key) Retrieves the value of an argument associated with a player and key.getPlayerArgument(org.bukkit.entity.Player player, String key) Retrieves the value of an argument associated with a player and key.voidloadCommand(org.bukkit.plugin.Plugin plugin, File file) Loads a specific command from a plugin's configuration file.voidLoads commands from the configuration files.voidregisterCommand(Command command) Registers a newCommand.booleanReloads a specific command.voidsetPlayerArgument(org.bukkit.entity.Player player, String key, String value) Registers a key-value pair for the arguments of a command associated with a player.voidunregisterCommands(Command command) Unregisters a specific command.voidunregisterCommands(org.bukkit.plugin.Plugin plugin) Unregisters all commands associated with a specific plugin.Methods inherited from interface fr.maxlego08.menu.zcore.utils.storage.Savable
load, save
-
Method Details
-
getCommands
Returns the list of commands associated with a specific plugin.- Parameters:
plugin- The plugin for which to retrieve commands.- Returns:
- A collection of commands associated with the plugin.
-
getCommands
Collection<Command> getCommands()Returns all registered commands.- Returns:
- A collection of all registered commands.
-
unregisterCommands
void unregisterCommands(org.bukkit.plugin.Plugin plugin) Unregisters all commands associated with a specific plugin.- Parameters:
plugin- The plugin for which to unregister commands.
-
loadCommands
void loadCommands()Loads commands from the configuration files. -
loadCommand
Loads a specific command from a plugin's configuration file.- Parameters:
plugin- The plugin to which the command belongs.file- The configuration file of the command.
-
setPlayerArgument
Registers a key-value pair for the arguments of a command associated with a player.- Parameters:
player- The player for whom to register the arguments.key- The argument key.value- The argument value.
-
getPlayerArgument
Retrieves the value of an argument associated with a player and key.- Parameters:
uuid- The player uuid for whom to retrieve the argument.key- The argument key.- Returns:
- An optional containing the argument value, or empty if not found.
-
getPlayerArgument
Retrieves the value of an argument associated with a player and key.- Parameters:
player- The player for whom to retrieve the argument.key- The argument key.- Returns:
- An optional containing the argument value, or empty if not found.
-
getCommand
Retrieves the command associated with a specific name.- Parameters:
commandName- The name of the command.- Returns:
- An optional containing the associated command, or empty if not found.