Class TeamSubCommand
java.lang.Object
com.booksaw.betterTeams.commands.SubCommand
com.booksaw.betterTeams.commands.presets.TeamSubCommand
- Direct Known Subclasses:
AllyChatCommand,AllyCommand,AnchorCommand,BalCommand,BanCommand,ChatCommand,ChestClaimCommand,ChestRemoveallCommand,ChestRemoveCommand,ColorCommand,DelHome,DelwarpCommand,DemoteCommand,DepositCommand,DescriptionCommand,DisbandCommand,EchestCommand,HomeCommand,InviteCommand,KickCommand,LeaveCommand,NameCommand,NeutralCommand,OpenCommand,PromoteCommand,PvpCommand,RankupCommand,SetAnchorCommand,SethomeCommand,SetOwnerCommand,SetWarpCommand,TagCommand,TitleCommand,UnbanCommand,WarpCommand,WarpsCommand,WithdrawCommand
This class can be extended for any sub commands which require players to be
in a team
- Author:
- booksaw
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CommandResponsecheckRank(@NotNull TeamPlayer player, PlayerRank rank) checkRank(TeamPlayer player) abstract PlayerRankprotected @Nullable TeamgetMyTeam(org.bukkit.command.CommandSender sender) protected TeamSubCommand.TeamPlayerResultgetTeamPlayer(Team team, String name) booleanUsed to check if the commandSender needs to be a player, defaults to falseabstract CommandResponseonCommand(TeamPlayer player, String label, String[] args, Team team) This method is run if the player is in a teamThis method is called whenever the sub command is run, return the message (+ chat color if it should not be the default chat color)voidsetRequiredRank(PlayerRank requiredRank) Methods inherited from class com.booksaw.betterTeams.commands.SubCommand
addMetaStringList, addPlayerStringList, addTeamStringList, addTeamStringList, checkAsync, getArgMessage, getArguments, getCommand, getCommandAndArgMessage, getHelp, getHelpMessage, getMaximumArguments, getMinimumArguments, getNode, onTabComplete, runAsync
-
Field Details
-
checkRank
protected boolean checkRank
-
-
Constructor Details
-
TeamSubCommand
public TeamSubCommand()
-
-
Method Details
-
getMyTeam
-
onCommand
public CommandResponse onCommand(org.bukkit.command.CommandSender sender, String label, String[] args) Description copied from class:SubCommandThis 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:
onCommandin 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(TeamPlayer player, String label, String[] args, Team team) This method is run if the player is in a team- Parameters:
player- the player who is in a teamlabel- 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
-
needPlayer
public boolean needPlayer()Description copied from class:SubCommandUsed to check if the commandSender needs to be a player, defaults to false- Overrides:
needPlayerin classSubCommand- Returns:
- if the commandSender needs to be a player
-
getDefaultRank
- Returns:
- the rank that the player has to be by default for this command
-
checkRank
-
checkRank
-
getTeamPlayer
-
setRequiredRank
-
getRequiredRank
-