Interface CommandManager
public interface CommandManager
AdditionsPlus custom command manager.
Also manages cooldowns of items and menus.
-
Method Summary
Modifier and TypeMethodDescriptionint
checkCommand
(String command, String message, ActionSender sender) Check if the executed command is formatted correctly.void
checkCommandEvent
(org.bukkit.event.Cancellable event, String message, ActionSender sender) Check the command event for custom commands.long
getCooldown
(ActionSender sender, AdditionsCommand command) Get the command cooldown of a sender.long
getItemCooldown
(ActionSender sender, AdditionsItem item) Get the item cooldown of a sender.long
getLastCooldownTime
(ActionSender sender, AdditionsCommand command) Get the command cooldown of a sender.long
getLastItemCooldownTime
(ActionSender sender, AdditionsItem item) Get the last item cooldown of a sender.long
getLastMenuCooldownTime
(ActionSender sender, AdditionsMenu menu) Get the last menu cooldown of a sender.long
getMenuCooldown
(ActionSender sender, AdditionsMenu menu) Get the menu cooldown of a sender.void
performCommand
(String command, ActionSender sender, String message) Perform a custom command for a sender.void
setCooldown
(ActionSender sender, AdditionsCommand command) Set the command cooldown of a sender.void
setItemCooldown
(ActionSender sender, AdditionsItem item) Set the item cooldown of a sender.void
setMenuCooldown
(ActionSender sender, AdditionsMenu menu) Set the menu cooldown of a sender.
-
Method Details
-
getLastCooldownTime
Get the command cooldown of a sender.- Parameters:
sender
- Sender of the menu.command
-AdditionsCommand
to get cooldown of.- Returns:
Long
last cooldown of the sender.
-
getCooldown
Get the command cooldown of a sender.- Parameters:
sender
- Sender of the menu.command
-AdditionsCommand
to get cooldown of.- Returns:
Long
cooldown of the sender.
-
setCooldown
Set the command cooldown of a sender.- Parameters:
sender
- Sender of the command.command
-AdditionsCommand
to set cooldown of.
-
getLastItemCooldownTime
Get the last item cooldown of a sender.- Parameters:
sender
- Sender of the menu.item
-AdditionsItem
to get cooldown of.- Returns:
Long
last cooldown of the sender.
-
getItemCooldown
Get the item cooldown of a sender.- Parameters:
sender
- Sender of the menu.item
-AdditionsItem
to get cooldown of.- Returns:
Long
cooldown of the sender.
-
setItemCooldown
Set the item cooldown of a sender.- Parameters:
sender
- Sender of the menu.item
-AdditionsItem
to set cooldown of.
-
getLastMenuCooldownTime
Get the last menu cooldown of a sender.- Parameters:
sender
- Sender of the menu.menu
-AdditionsMenu
to get cooldown of.- Returns:
Long
last cooldown of the sender.
-
getMenuCooldown
Get the menu cooldown of a sender.- Parameters:
sender
- Sender of the menu.menu
-AdditionsMenu
to get cooldown of.- Returns:
Long
cooldown of the sender.
-
setMenuCooldown
Set the menu cooldown of a sender.- Parameters:
sender
- Sender of the menu.menu
-AdditionsMenu
to set cooldown of.
-
checkCommandEvent
Check the command event for custom commands.- Parameters:
event
- Bukkit event to check.message
- Command string as executed by the sender.sender
- Sender of the command.
-
checkCommand
Check if the executed command is formatted correctly.- Parameters:
command
- Name of the command.message
- Command string as executed by the sender.sender
- Sender of the command.- Returns:
- 1 if succeeded, error code otherwise.
-
performCommand
Perform a custom command for a sender.- Parameters:
command
- Name of the command.sender
- Sender of the command.message
- Command string as executed by the sender.
-