Class VisibilityGroup

java.lang.Object
net.apartium.cocoabeans.spigot.visibility.VisibilityGroup

public class VisibilityGroup extends Object
Represents a group of players who can see each other, and can or cannot see different visibility group Each visibility group is identified by a unique name and belongs to a VisibilityManager instance
  • Method Details

    • addPlayer

      public boolean addPlayer(org.bukkit.entity.Player player)
      Add a member to this group.
      Parameters:
      player - player to add
      Returns:
      false if already a member of this group, else false
    • addPlayer

      public boolean addPlayer(UUID uuid)
      Add a member to this group.
      Parameters:
      uuid - unique id of player to add
      Returns:
      false if already a member of this group, else false
    • addPlayer

      public boolean addPlayer(VisibilityPlayer player)
      Add a member to this group.
      Parameters:
      player - player to add
      Returns:
      false if already a member of this group, else false
    • removePlayer

      public boolean removePlayer(org.bukkit.entity.Player player)
      Removes a player from the group
      Parameters:
      player - player to remove
      Returns:
      true if was part of the group, else false
    • removePlayer

      public boolean removePlayer(VisibilityPlayer player)
      Removes a player from the group
      Parameters:
      player - player to remove
      Returns:
      true if was part of the group, else false
    • addVisibleGroup

      public boolean addVisibleGroup(VisibilityGroup group)
      Adds a group which members of the current group can see
      Parameters:
      group - group
      Returns:
      true if existed, false otherwise
    • addHiddenGroup

      public boolean addHiddenGroup(VisibilityGroup group)
      Adds a group which members of the current group cannot see
      Parameters:
      group - group
      Returns:
      true if existed, false otherwise
    • removeVisibleGroup

      public boolean removeVisibleGroup(VisibilityGroup group)
      Remove visible group
      Parameters:
      group - group
      Returns:
      true if removed, false if doesn't exist
      See Also:
    • removeHiddenGroup

      public boolean removeHiddenGroup(VisibilityGroup group)
      Remove hidden group
      Parameters:
      group - group
      Returns:
      true if removed, false if doesn't exist
      See Also:
    • getPlayers

      public Collection<VisibilityPlayer> getPlayers()
      Get all players who are direct members of this group
      Returns:
      unmodifiable viwe of backing collection
    • getName

      public String getName()
      Get name of visibility group
      Returns:
      visibility group name
    • getVisibleGroups

      public Collection<VisibilityGroup> getVisibleGroups()
      Get all groups who are visible to current group
      Returns:
      unmodifiable view of backing collection
    • getHiddenGroups

      public Collection<VisibilityGroup> getHiddenGroups()
      Get all groups who are hidden from current group
      Returns:
      unmodifiable view of backing collection
    • hasPlayer

      public boolean hasPlayer(org.bukkit.entity.Player player)
      Checks whether group contains a player
      Parameters:
      player - player
      Returns:
      true if contains given player, else false