Package net.jeqo.bloons.commands.manager
Class CommandCore
java.lang.Object
net.jeqo.bloons.commands.manager.CommandCore
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
Handles the core functionality of commands and their restrictive access
-
Constructor Summary
ConstructorsConstructorDescriptionCommandCore(org.bukkit.plugin.java.JavaPlugin providedPlugin) Creates a new instance of the command core -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(Command command) Adds a command to the commands listgetCommandDescription(String commandAlias) Gets a commands description by its aliasbooleanmeetsRequirements(Command command, org.bukkit.command.CommandSender sender) Checks if the player sending the command meets the requirements to execute the commandbooleanonCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, String[] args) Executes the commandvoidRegisters all commands in the commands list
-
Constructor Details
-
CommandCore
public CommandCore(org.bukkit.plugin.java.JavaPlugin providedPlugin) Creates a new instance of the command core- Parameters:
providedPlugin- The plugin instance, type org.bukkit.plugin.java.JavaPlugin
-
-
Method Details
-
registerCommands
public void registerCommands()Registers all commands in the commands list -
getCommandDescription
Gets a commands description by its alias- Parameters:
commandAlias- The alias of the command, type java.lang.String- Returns:
- The description of the command, type java.lang.String
-
addCommand
Adds a command to the commands list- Parameters:
command- The command to add, type net.jeqo.bloons.commands.manager.Command
-
onCommand
public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, String[] args) Executes the command- Specified by:
onCommandin interfaceorg.bukkit.command.CommandExecutor- Parameters:
sender- Source of the command, type org.bukkit.command.CommandSendercommand- Command which was executed, type org.bukkit.command.Commandlabel- Alias of the command which was used, type java.lang.Stringargs- Passed command arguments, type java.lang.String[]- Returns:
- Whether the command was executed successfully, type boolean
-
meetsRequirements
Checks if the player sending the command meets the requirements to execute the command- Parameters:
command- The command to check, type net.jeqo.bloons.commands.manager.Commandsender- The sender of the command, type org.bukkit.command.CommandSender- Returns:
- Whether the user meets the requirements, type boolean
-