Class CommandHandler

java.lang.Object
ua.mcchickenstudio.opencreative.commands.CommandHandler
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter
Direct Known Subclasses:
AdvertisementCommand, BuildCommand, ChatCommand, CreativeCommand, DevCommand, DislikeCommand, EditCommand, EnvironmentCommand, GamemodeCommand, GiveCommand, JoinCommand, JoinToCommand, LikeCommand, LocateCommand, MenuCommand, ModuleCommand, OwnMenuCommand, PlayCommand, PlaySoundCommand, SpawnCommand, StopSoundCommand, TeleportCommand, TimeCommand, ValueCommand, WeatherCommand, WorldCommand

public abstract class CommandHandler extends Object implements org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter

CommandHandler

This class represents executor and tab completer for OpenCreative+ commands.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    onCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
     
    abstract void
    onExecute(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
    Executes command for sender.
    abstract @Nullable List<String>
    onTab(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args)
    Returns list of tab completions, that can suggest arguments for command sender, or null.
    final @Nullable List<String>
    onTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommandHandler

      public CommandHandler()
  • Method Details

    • onExecute

      public abstract void onExecute(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args)
      Executes command for sender.
      Parameters:
      sender - sender of command, can be player or console.
      command - command, that was executed.
      label - label of command (name of command after slash /).
      args - arguments of command.
    • onTab

      @Nullable public abstract @Nullable List<String> onTab(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String alias, @NotNull @NotNull String[] args)
      Returns list of tab completions, that can suggest arguments for command sender, or null.
      Parameters:
      sender - sender of command.
      command - command, that was requested.
      alias - label of command (name of command after slash /).
      args - arguments of command.
      Returns:
      list of suggestions for arguments, or null.
    • onCommand

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

      @Nullable public final @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