Class CommandCore

java.lang.Object
net.jeqo.bloons.commands.manager.CommandCore
All Implemented Interfaces:
org.bukkit.command.CommandExecutor

public class CommandCore extends Object implements org.bukkit.command.CommandExecutor
Handles the core functionality of commands and their restrictive access
  • 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

      public String getCommandDescription(String commandAlias)
      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

      public void addCommand(Command command)
      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:
      onCommand in interface org.bukkit.command.CommandExecutor
      Parameters:
      sender - Source of the command, type org.bukkit.command.CommandSender
      command - Command which was executed, type org.bukkit.command.Command
      label - Alias of the command which was used, type java.lang.String
      args - Passed command arguments, type java.lang.String[]
      Returns:
      Whether the command was executed successfully, type boolean
    • meetsRequirements

      public boolean meetsRequirements(Command command, org.bukkit.command.CommandSender sender)
      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.Command
      sender - The sender of the command, type org.bukkit.command.CommandSender
      Returns:
      Whether the user meets the requirements, type boolean