Class TeamManager

java.lang.Object
net.minestom.server.scoreboard.TeamManager

public final class TeamManager
extends java.lang.Object
An object which manages all the Team's
  • Constructor Summary

    Constructors 
    Constructor Description
    TeamManager()
    Default constructor
  • Method Summary

    Modifier and Type Method Description
    TeamBuilder createBuilder​(java.lang.String name)
    Initializes a new TeamBuilder for creating a team
    Team createTeam​(java.lang.String name)
    Creates a Team with only the registry name
    Team createTeam​(java.lang.String name, ColoredText prefix, ChatColor teamColor, ColoredText suffix)
    Creates a Team with the registry name, prefix, suffix and the team color
    Team createTeam​(java.lang.String name, ColoredText displayName, ColoredText prefix, ChatColor teamColor, ColoredText suffix)
    Creates a Team with the registry name, display name, prefix, suffix and the team colro
    boolean deleteTeam​(java.lang.String registryName)
    Deletes a Team
    boolean deleteTeam​(Team team)
    Deletes a Team
    boolean exists​(java.lang.String teamName)
    Checks if the given name a registry name of a registered Team
    boolean exists​(Team team)
    Checks if the given Team registered
    java.util.List<java.lang.String> getEntities​(Team team)
    Gets a List with all registered LivingEntity in the team
    Note: The list exclude all players.
    java.util.List<java.lang.String> getPlayers​(Team team)
    Gets a List with all registered Player in the team
    Note: The list exclude all entities.
    Team getTeam​(java.lang.String teamName)
    Gets a Team with the given name
    java.util.Set<Team> getTeams()
    Gets a Set with all registered Team's
    protected void registerNewTeam​(Team team)
    Registers a new Team

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TeamManager

      public TeamManager()
      Default constructor
  • Method Details

    • registerNewTeam

      protected void registerNewTeam​(@NotNull Team team)
      Registers a new Team
      Parameters:
      team - The team to be registered
    • deleteTeam

      public boolean deleteTeam​(@NotNull java.lang.String registryName)
      Deletes a Team
      Parameters:
      registryName - The registry name of team
      Returns:
      true if the team was deleted, otherwise false
    • deleteTeam

      public boolean deleteTeam​(@NotNull Team team)
      Deletes a Team
      Parameters:
      team - The team to be deleted
      Returns:
      true if the team was deleted, otherwise false
    • createBuilder

      public TeamBuilder createBuilder​(@NotNull java.lang.String name)
      Initializes a new TeamBuilder for creating a team
      Parameters:
      name - The registry name of the team
      Returns:
      the team builder
    • createTeam

      public Team createTeam​(@NotNull java.lang.String name)
      Creates a Team with only the registry name
      Parameters:
      name - The registry name
      Returns:
      the created Team
    • createTeam

      public Team createTeam​(java.lang.String name, ColoredText prefix, ChatColor teamColor, ColoredText suffix)
      Creates a Team with the registry name, prefix, suffix and the team color
      Parameters:
      name - The registry name
      prefix - The team prefix
      teamColor - The team color
      suffix - The team suffix
      Returns:
      the created Team with a prefix, teamColor and suffix
    • createTeam

      public Team createTeam​(java.lang.String name, ColoredText displayName, ColoredText prefix, ChatColor teamColor, ColoredText suffix)
      Creates a Team with the registry name, display name, prefix, suffix and the team colro
      Parameters:
      name - The registry name
      displayName - The display name
      prefix - The team prefix
      teamColor - The team color
      suffix - The team suffix
      Returns:
      the created Team with a prefix, teamColor, suffix and the display name
    • getTeam

      public Team getTeam​(java.lang.String teamName)
      Gets a Team with the given name
      Parameters:
      teamName - The registry name of the team
      Returns:
      a registered Team or null
    • exists

      public boolean exists​(java.lang.String teamName)
      Checks if the given name a registry name of a registered Team
      Parameters:
      teamName - The name of the team
      Returns:
      true if the team is registered, otherwise false
    • exists

      public boolean exists​(Team team)
      Checks if the given Team registered
      Parameters:
      team - The searched team
      Returns:
      true if the team is registered, otherwise false
    • getPlayers

      public java.util.List<java.lang.String> getPlayers​(Team team)
      Gets a List with all registered Player in the team
      Note: The list exclude all entities. To get all entities of the team, you can use getEntities(Team)
      Parameters:
      team - The team
      Returns:
      a List with all registered Player
    • getEntities

      public java.util.List<java.lang.String> getEntities​(Team team)
      Gets a List with all registered LivingEntity in the team
      Note: The list exclude all players. To get all players of the team, you can use getPlayers(Team)
      Parameters:
      team - The team
      Returns:
      a List with all registered LivingEntity
    • getTeams

      public java.util.Set<Team> getTeams()
      Gets a Set with all registered Team's
      Returns:
      a Set with all registered Team's