Interface TeamManager


@NonExtendable public interface TeamManager
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Team
    getTeam(@NotNull String teamIdentifier)
    Tries to find a registered team with the given string identifier.
    @Nullable Team
    getTeamFromMember(@NotNull UUID uuid)
    Tries to return the team where the given UUID is on.
    @Nullable Team
    getTeamFromMember(@NotNull org.bukkit.entity.Entity entity)
    Tries to return the team where the given entity is on.
    @NotNull com.google.common.collect.ImmutableMap<String,Team>
    Returns an immutable collection of teams.
    boolean
    isMember(@NotNull UUID uuid)
    Checks if the given UUID is a member on any registered team.
    boolean
    isMember(@NotNull org.bukkit.entity.Entity entity)
    Checks if the given Entity is a member on any registered team.
    @Nullable Boolean
    isPersistent(@NotNull String teamIdentifier)
    Returns if the team with the given identifier is persistent or not.
    @Nullable Boolean
    isPersistent(@NotNull Team team)
    Returns if the given team is persistent or not.
    boolean
    isRegisteredTeam(@NotNull String teamIdentifier)
    Checks if the given team is registered in this manager by its name.
    boolean
    isRegisteredTeam(@NotNull Team team)
    Checks if the given team is registered in this manager.
    boolean
    joinTeam(@NotNull UUID uuid, @NotNull Team team)
    Tries to make a member join the given team.
    boolean
    joinTeam(@NotNull org.bukkit.entity.Entity entity, @NotNull Team team)
    Tries to make a member join the given team.
    boolean
    leaveTeam(@NotNull UUID uuid, @NotNull Team team)
    Makes the given member leave the given team.
    boolean
    leaveTeam(@NotNull org.bukkit.entity.Entity entity, @NotNull Team team)
    Makes the given member leave the given team.
    boolean
    registerTeam(@NotNull Team team, boolean persist)
    Registers a team so that it can be found and optionally persist in storage.
    Returns a Stream representation of all loaded teams paired with their unique key.
    void
    unregisterTeam(@NotNull String teamIdentifier)
    Unregisters a team from this manager.
    void
    unregisterTeam(@NotNull Team team)
    Unregisters a team from this manager.
  • Method Details

    • getTeam

      @Nullable @Nullable Team getTeam(@NotNull @NotNull String teamIdentifier)
      Tries to find a registered team with the given string identifier.
      Parameters:
      teamIdentifier - the identifier of the team instance to get
      Returns:
      The Team with the given identifier, or null if not found
    • registerTeam

      boolean registerTeam(@NotNull @NotNull Team team, boolean persist)
      Registers a team so that it can be found and optionally persist in storage.
      Parameters:
      team - The team instance to register
      persist - If this registered team should persist in storage.
      Returns:
      true if the team was registered successfully.
    • isRegisteredTeam

      @Contract(pure=true) boolean isRegisteredTeam(@NotNull @NotNull String teamIdentifier)
      Checks if the given team is registered in this manager by its name.
      Parameters:
      teamIdentifier - The unique name of the team
      Returns:
      true if the team is registered in this manager.
    • isRegisteredTeam

      @Contract(pure=true) boolean isRegisteredTeam(@NotNull @NotNull Team team)
      Checks if the given team is registered in this manager.
      Parameters:
      team - the team to check
      Returns:
      true if the team is registered in this manager.
    • isPersistent

      @Contract(pure=true) @Nullable @Nullable Boolean isPersistent(@NotNull @NotNull String teamIdentifier)
      Returns if the team with the given identifier is persistent or not. This will be null when not registered.
      Parameters:
      teamIdentifier - The unique name of the team to check
      Returns:
      true if the team is marked as persistent, or null if not registered.
    • isPersistent

      @Contract(pure=true) @Nullable @Nullable Boolean isPersistent(@NotNull @NotNull Team team)
      Returns if the given team is persistent or not. This will be null when not registered.
      Parameters:
      team - The team to check
      Returns:
      true if the team is marked as persistent, or null if not registered.
    • unregisterTeam

      void unregisterTeam(@NotNull @NotNull String teamIdentifier)
      Unregisters a team from this manager. This will fire a TeamUnregisterEvent.
      Parameters:
      teamIdentifier - The unique name of the team to remove
    • unregisterTeam

      void unregisterTeam(@NotNull @NotNull Team team)
      Unregisters a team from this manager. This will fire a TeamUnregisterEvent.
      Parameters:
      team - The team to remove
    • getTeamFromMember

      @Nullable @Nullable Team getTeamFromMember(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Tries to return the team where the given entity is on.
      Parameters:
      entity - The entity to check
      Returns:
      The Team the entity is in, or null if the entity is in no team.
    • getTeamFromMember

      @Nullable @Nullable Team getTeamFromMember(@NotNull @NotNull UUID uuid)
      Tries to return the team where the given UUID is on.
      Parameters:
      uuid - The UUID to check
      Returns:
      The Team the UUID is on, or null if the UUID is on no team.
    • isMember

      @Contract(pure=true) boolean isMember(@NotNull @NotNull UUID uuid)
      Checks if the given UUID is a member on any registered team.
    • isMember

      @Contract(pure=true) boolean isMember(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Checks if the given Entity is a member on any registered team.
    • getTeams

      @Contract(pure=true) @NotNull @NotNull com.google.common.collect.ImmutableMap<String,Team> getTeams()
      Returns an immutable collection of teams.
      Returns:
      a ImmutableMap of teams that might contain no entries.
    • teams

      @NotNull @NotNull Stream<Map.Entry<String,Team>> teams()
      Returns a Stream representation of all loaded teams paired with their unique key.
      Returns:
      Stream containing all loaded teams and their keys
    • joinTeam

      boolean joinTeam(@NotNull @NotNull UUID uuid, @NotNull @NotNull Team team)
      Tries to make a member join the given team.
    • joinTeam

      boolean joinTeam(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Team team)
      Tries to make a member join the given team.
    • leaveTeam

      boolean leaveTeam(@NotNull @NotNull UUID uuid, @NotNull @NotNull Team team)
      Makes the given member leave the given team.
    • leaveTeam

      boolean leaveTeam(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Team team)
      Makes the given member leave the given team.