Class CommandBase

java.lang.Object
io.github.simplexdevelopment.cl.Permissible
io.github.simplexdevelopment.cl.CommandBase
All Implemented Interfaces:
ICommand, org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter
Direct Known Subclasses:
ExampleCommand

public abstract class CommandBase extends Permissible implements ICommand
  • Constructor Details

    • CommandBase

      public CommandBase(@NotNull @NotNull String permission, String permissionMessage, boolean allowConsole)
      Parameters:
      permission - The permission the user should have to run the command
      permissionMessage - The message to send when the user does not have the permission to run the command.
      allowConsole - Whether to allow the command to be run anywhere, or only in game.
    • CommandBase

      public CommandBase(@NotNull @NotNull String permission, String permissionMessage)
      Parameters:
      permission - The permission the user should have to run the command
      permissionMessage - The message to send when the user does not have the permission to run the command.
    • CommandBase

      public CommandBase(@NotNull @NotNull String permission, boolean allowConsole)
      Parameters:
      permission - The permission the user should have to run the command
      allowConsole - Whether to allow the command to be run anywhere, or only in game.
    • CommandBase

      public CommandBase(@NotNull @NotNull String permission)
      Parameters:
      permission - The permission the user should have to run the command
  • Method Details

    • onCommand

      public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String lbl, String[] args)
      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
    • onTabComplete

      @Nullable public @Nullable List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String alias, @NotNull @NotNull String[] args)
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
    • msg

      @NotNull public @NotNull net.kyori.adventure.text.TextComponent msg(@NotNull @NotNull String text)
      Returns a text component for Kyori friendly messaging.
      Parameters:
      text - The text to convert to a component
      Returns:
      A TextComponent containing the message provided in
    • msg

      @NotNull public @NotNull net.kyori.adventure.text.TextComponent msg(@NotNull @NotNull String text, @NotNull @NotNull BasicColors color)
      Returns a text component for Kyori friendly messaging.
      Parameters:
      text - The text to convert to a Component
      color - The color you'd like the text. These colors are basic and the majority of which are provided by Minecraft's native color system.
      Returns:
      A TextComponent containing the message provided in with the provided
    • msg

      @NotNull public @NotNull net.kyori.adventure.text.TextComponent msg(@NotNull @NotNull String text, @NotNull @NotNull AdvancedColors color)
      Returns a text component for Kyori friendly messaging.
      Parameters:
      text - The text to convert to a Component
      color - The color you'd like the text. These colors are much more diverse for viewing pleasure.
      Returns:
      A TextComponent containing the message provided in with the provided
    • subCommand

      public boolean subCommand(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String permission, String @NotNull [] args, @NotNull @NotNull SubCommand command)
      Runs a subcommand provided that the user has the required permission.
      Parameters:
      name - The name of the subcommand.
      sender - The user who executed the command. (Provided by Paper)
      permission - The permission required to run the subcommand.
      args - The arguments the user input to run the subcommand. (Provided by Paper)
      command - The SubCommand to run. This is a functional interface to provide easy implementation of the command's details.
    • getPlayer

      @Nullable public @Nullable org.bukkit.entity.Player getPlayer(@NotNull @NotNull String name)
    • getPlayer

      @Nullable public @Nullable org.bukkit.entity.Player getPlayer(@NotNull @NotNull UUID uuid)
    • getOnlinePlayers

      public List<? extends org.bukkit.entity.Player> getOnlinePlayers()
    • broadcast

      public void broadcast(String text)
    • broadcast

      public void broadcast(String text, BasicColors color)
    • broadcast

      public void broadcast(String text, AdvancedColors color)
    • enablePlugin

      public void enablePlugin(org.bukkit.plugin.Plugin plugin)
    • disablePlugin

      public void disablePlugin(org.bukkit.plugin.Plugin plugin)