public abstract class LapisCoreCommand
extends org.bukkit.command.defaults.BukkitCommand
| Modifier | Constructor and Description |
|---|---|
protected |
LapisCoreCommand(LapisCorePlugin core,
String name,
String desc,
ArrayList<String> aliases)
If in doubt use this constructor
|
protected |
LapisCoreCommand(LapisCorePlugin core,
String name,
String desc,
ArrayList<String> aliases,
boolean takeConflicts)
This constructor allows you to take conflicting commands and aliases
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(org.bukkit.command.CommandSender sender,
String commandLabel,
String[] args) |
protected boolean |
isNotPlayer(org.bukkit.command.CommandSender sender,
String key)
Test if the sender is a player and send them a message if they are not a player
|
protected boolean |
isPermitted(org.bukkit.command.CommandSender sender,
LapisPermission permission)
Check if a sender is permitted, requires
LapisCorePermissions to be registered in LapisCorePlugin |
protected abstract void |
onCommand(org.bukkit.command.CommandSender sender,
String[] args) |
protected void |
onCommand(org.bukkit.command.CommandSender sender,
String commandLabel,
String[] args) |
protected void |
registerTabCompleter(org.bukkit.command.TabCompleter completer)
Registers the given class as the tab completer for this command
|
protected void |
sendMessage(org.bukkit.command.CommandSender sender,
String key)
Send a message from the messages.yml to the command sender provided,
requires
LapisCoreConfiguration to be registered in LapisCorePlugin |
List<String> |
tabComplete(org.bukkit.command.CommandSender sender,
String alias,
String[] args)
Calls the default behaviour unless a tab completer has been set with
registerTabCompleter(TabCompleter),
from 1.13 onwards this is constantly triggered for possible completions displayed above the chat bar |
broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getName, getPermission, getPermissionMessage, getUsage, isRegistered, register, setAliases, setDescription, setLabel, setName, setPermission, setPermissionMessage, setUsage, tabComplete, testPermission, testPermissionSilent, toString, unregisterprotected LapisCoreCommand(LapisCorePlugin core, String name, String desc, ArrayList<String> aliases)
core - The LapisCorePlugin that the command should be registered toname - The name of the command, this wont include the slashdesc - The description for the /help menualiases - Any aliases that should run this commandprotected LapisCoreCommand(LapisCorePlugin core, String name, String desc, ArrayList<String> aliases, boolean takeConflicts)
core - The LapisCorePlugin that the command should be registered toname - The name of the command, this wont include the slashdesc - The description for the /help menualiases - Any aliases that should run this commandtakeConflicts - Set to true if you would like to forcefully take control of any commands of the same name or aliasprotected void registerTabCompleter(org.bukkit.command.TabCompleter completer)
completer - The class you wish to deal with tab completions for this commandprotected boolean isPermitted(org.bukkit.command.CommandSender sender,
LapisPermission permission)
LapisCorePermissions to be registered in LapisCorePluginsender - The sender of a command, player or consolepermission - The LapisPermission you wish to checkPlayerprotected void sendMessage(org.bukkit.command.CommandSender sender,
String key)
LapisCoreConfiguration to be registered in LapisCorePluginsender - The command sender who you wish to send a message tokey - The key for the message in the messages.ymlprotected boolean isNotPlayer(org.bukkit.command.CommandSender sender,
String key)
sender - The command sender you wish to test forkey - The key of the message they should receive if they are not a playerpublic boolean execute(org.bukkit.command.CommandSender sender,
String commandLabel,
String[] args)
execute in class org.bukkit.command.Commandprotected void onCommand(org.bukkit.command.CommandSender sender,
String commandLabel,
String[] args)
protected abstract void onCommand(org.bukkit.command.CommandSender sender,
String[] args)
public List<String> tabComplete(org.bukkit.command.CommandSender sender, String alias, String[] args)
registerTabCompleter(TabCompleter),
from 1.13 onwards this is constantly triggered for possible completions displayed above the chat bartabComplete in class org.bukkit.command.Commandsender - The sender who has attempted to tab completealias - Alias of the command that they are usingargs - The current arguments of the commandCopyright © 2019. All rights reserved.