Class TeamSelectSubCommand
java.lang.Object
com.booksaw.betterTeams.commands.SubCommand
com.booksaw.betterTeams.commands.presets.TeamSelectSubCommand
- Direct Known Subclasses:
ChestClaimTeama
,ChestRemoveallTeama
,ColorTeama
,DescriptionTeama
,DisbandTeama
,EchestTeama
,InviteTeama
,MetaGetTeama
,MetaRemoveTeama
,MetaSetTeama
,NameTeama
,OpenTeama
,SetrankTeama
,TagTeama
This class is used for admin commands which reference a specific team
remember args[0] will be the team name
- Author:
- nfgg2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method is called whenever the sub command is run, return the message (+ chat color if it should not be the default chat color)abstract CommandResponse
This method is run if the player is in a teamprotected Team
resolveTeam
(String identifier) resolve a team from either a team name or a player nameMethods inherited from class com.booksaw.betterTeams.commands.SubCommand
addMetaStringList, addPlayerStringList, addTeamStringList, addTeamStringList, checkAsync, getArgMessage, getArguments, getCommand, getCommandAndArgMessage, getHelp, getHelpMessage, getMaximumArguments, getMinimumArguments, getNode, needPlayer, onTabComplete, runAsync
-
Constructor Details
-
TeamSelectSubCommand
public TeamSelectSubCommand()
-
-
Method Details
-
onCommand
public CommandResponse onCommand(org.bukkit.command.CommandSender sender, String label, String[] args) Description copied from class:SubCommand
This method is called whenever the sub command is run, return the message (+ chat color if it should not be the default chat color)
The return value should be the value of the message to be sent to the user, for more complicated messaging systems return null
- Specified by:
onCommand
in classSubCommand
- Parameters:
sender
- the person who called the commandlabel
- the label of the initial command (useful for help files)args
- the arguments of the sub command (starting at args[0], as the sub command itself will be removed)- Returns:
- the message
-
onCommand
public abstract CommandResponse onCommand(org.bukkit.command.CommandSender sender, String label, String[] args, Team team) This method is run if the player is in a team- Parameters:
sender
- the player who ran the commnadlabel
- the label for the commandargs
- the arguments for the commandteam
- the team that the player is in- Returns:
- the message reference to send to the user
-
resolveTeam
resolve a team from either a team name or a player name- Parameters:
identifier
- The string which could be a team name or a player name- Returns:
- The resolved Team, or null if not found
-