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 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanonCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args) abstract voidonExecute(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args) Executes command for sender.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.onTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args)
-
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
-
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:
onTabCompletein interfaceorg.bukkit.command.TabCompleter
-