Class Team
java.lang.Object
at.setup_studios.mc_milsim.gameplay.player.Team
Represents a team in the game with players management functionality.
Each team has a name, maximum player capacity, and a specific color.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a player to the team if there's available space.net.minecraft.ChatFormattinggetColor()intintgetName()Converts the list of players to a list of player names.booleanvoidremovePlayer(ModPlayer player) Removes a player from the team.toString()Returns a string representation of the team.
-
Constructor Details
-
Team
Constructs a new team with specified parameters.- Parameters:
teamName- The name of the teammaxPlayers- The maximum number of players allowed in the teamcolor- The color formatting for the team's name
-
-
Method Details
-
addPlayer
Adds a player to the team if there's available space. If the team is full or player is null, appropriate messages are logged.- Parameters:
player- The player to be added to the team
-
removePlayer
Removes a player from the team. Logs a warning if the player is null.- Parameters:
player- The player to be removed from the team
-
getPlayersAsString
-
toString
Returns a string representation of the team. The string includes the team's name, the current number of players, the maximum number of players allowed, and the color associated with the team's name. -
getPlayers
-
getName
-
getColor
public net.minecraft.ChatFormatting getColor() -
hasAvailableSpace
public boolean hasAvailableSpace() -
getCurrentPlayers
public int getCurrentPlayers() -
getMaxPlayers
public int getMaxPlayers()
-