public abstract class AnnoyingCommand extends Registrable implements org.bukkit.command.TabExecutor
Registrable.Ignore| Constructor and Description |
|---|
AnnoyingCommand()
Constructs a new command instance for registration
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull java.util.function.Predicate<java.lang.String[]> |
getArgsPredicate()
OPTIONAL The command's arguments will be tested against this predicate |
@NotNull java.lang.String |
getName()
OPTIONAL This is the name of the command |
@Nullable java.lang.String |
getPermission()
OPTIONAL This is the permission required to use the command |
boolean |
isPlayerOnly()
OPTIONAL Whether the command is player-only (no console), default: false |
abstract void |
onCommand(@NotNull AnnoyingSender sender)
REQUIRED This is everything that's executed when the command is run |
boolean |
onCommand(@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull org.bukkit.command.Command cmd,
@NotNull java.lang.String label,
@NotNull java.lang.String[] args)
Executes the given command, returning its success.
|
@Nullable java.util.Collection<java.lang.String> |
onTabComplete(@NotNull AnnoyingSender sender)
OPTIONAL This is the tab completion for the command |
java.util.List<java.lang.String> |
onTabComplete(@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull org.bukkit.command.Command cmd,
@NotNull java.lang.String label,
@NotNull java.lang.String[] args)
Requests a list of possible completions for a command argument.
|
void |
register()
Registers the command to the
Annoyable.getAnnoyingPlugin() |
void |
unregister()
Unregisters the command from the
Annoyable.getAnnoyingPlugin() |
isRegistered, setRegisteredclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAnnoyingPluginpublic AnnoyingCommand()
@NotNull public @NotNull java.lang.String getName()
OPTIONAL This is the name of the command
If not specified, the lowercase class name will be used (Command will be removed)
Example: the command class MyEpicCommand would be registered as myepic
@Nullable public @Nullable java.lang.String getPermission()
OPTIONAL This is the permission required to use the command
If not specified (or null), no permission will be required
public boolean isPlayerOnly()
OPTIONAL Whether the command is player-only (no console), default: false@NotNull public @NotNull java.util.function.Predicate<java.lang.String[]> getArgsPredicate()
OPTIONAL The command's arguments will be tested against this predicate
This is usually used to check if the command has the correct amount of arguments
If not specified, any arguments will be accepted
public void register()
Annoyable.getAnnoyingPlugin()register in class Registrablepublic void unregister()
Annoyable.getAnnoyingPlugin()unregister in class Registrablepublic abstract void onCommand(@NotNull
@NotNull AnnoyingSender sender)
REQUIRED This is everything that's executed when the command is runsender - the sender of the command@Nullable
public @Nullable java.util.Collection<java.lang.String> onTabComplete(@NotNull
@NotNull AnnoyingSender sender)
OPTIONAL This is the tab completion for the command
BukkitUtility will come in handy
sender - the sender of the commandCollection of suggestionspublic boolean onCommand(@NotNull
@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull
@NotNull org.bukkit.command.Command cmd,
@NotNull
@NotNull java.lang.String label,
@NotNull
@NotNull java.lang.String[] args)
onCommand in interface org.bukkit.command.CommandExecutorcmdSender - Source of the commandcmd - Command which was executedlabel - Alias of the command which was usedargs - Passed command argumentspublic java.util.List<java.lang.String> onTabComplete(@NotNull
@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull
@NotNull org.bukkit.command.Command cmd,
@NotNull
@NotNull java.lang.String label,
@NotNull
@NotNull java.lang.String[] args)
onTabComplete in interface org.bukkit.command.TabCompletercmdSender - Source of the command. For players tab-completing a command inside a command block, this will be the player, not the command block.cmd - Command which was executedlabel - Alias of the command which was usedargs - The arguments passed to the command, including final partial argument to be completed