Package me.neznamy.tab.shared.command
Class SubCommand
java.lang.Object
me.neznamy.tab.shared.command.SubCommand
- Direct Known Subclasses:
AnnounceBarCommand,AnnounceCommand,AnnounceScoreboardCommand,BossBarCommand,CpuCommand,DebugCommand,GroupsCommand,MySQLCommand,NameTagCommand,ParseCommand,PropertyCommand,ReloadCommand,ScoreboardCommand,SendBarCommand,SendCommand,SetCollisionCommand,TabCommand,WidthCommand
Abstract class representing a subcommand of "/tab" command
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubCommand(String name, String permission) Constructs new instance with given parameters -
Method Summary
Modifier and TypeMethodDescriptionPerforms command complete and returns list of arguments to be shownabstract voidPerforms the commandstatic String[]getName()Returns name of this commandgetOnlinePlayers(String nameStart) Returns all players whose name start with given stringgetStartingArgument(Collection<String> values, String argument) booleanhasPermission(me.neznamy.tab.api.TabPlayer sender) Returns whether player has permission to run this command or notbooleanhasPermission(me.neznamy.tab.api.TabPlayer sender, String permission) Returns whether player has given permission or notvoidregisterSubCommand(SubCommand subcommand) Registers new subcommandvoidsendMessage(me.neznamy.tab.api.TabPlayer sender, String message) Sends message to the command sender with colors translatedvoidsendMessages(me.neznamy.tab.api.TabPlayer sender, List<String> messages) Sends messages to the command sender with colors translatedvoidsendRawMessage(me.neznamy.tab.api.TabPlayer sender, String message) Sends message to the command sender without colors translatedstatic voidsetAllProperties(String[] allProperties)
-
Field Details
-
extraProperties
-
-
Constructor Details
-
SubCommand
Constructs new instance with given parameters- Parameters:
name- command namepermission- permission requirement
-
-
Method Details
-
getName
Returns name of this command- Returns:
- name of this command
-
hasPermission
public boolean hasPermission(me.neznamy.tab.api.TabPlayer sender) Returns whether player has permission to run this command or not- Parameters:
sender- player who ran command or null if console- Returns:
- true if sender has permission or is console, false otherwise
-
hasPermission
Returns whether player has given permission or not- Parameters:
sender- player who ran command or null if consolepermission- permission to check for- Returns:
- true if sender has permission or is console, false otherwise
-
sendMessages
Sends messages to the command sender with colors translated- Parameters:
sender- player or console to send the message tomessages- messages to send
-
sendMessage
Sends message to the command sender with colors translated- Parameters:
sender- player or console to send the message tomessage- the message to sent
-
sendRawMessage
Sends message to the command sender without colors translated- Parameters:
sender- player or console to send the message tomessage- the message to sent
-
getOnlinePlayers
Returns all players whose name start with given string- Parameters:
nameStart- beginning of the name- Returns:
- List of compatible players
-
getStartingArgument
-
complete
Performs command complete and returns list of arguments to be shown- Parameters:
sender- command senderarguments- arguments inserted in chat so far- Returns:
- List of possible arguments
-
getMessages
-
execute
Performs the command- Parameters:
sender- command sender or null if consoleargs- arguments of the command
-
getAllProperties
-
setAllProperties
-
getSubcommands