Class Member

java.lang.Object
net.ognetwork.ogcore.api.models.Member
All Implemented Interfaces:
Player

public class Member extends Object implements Player
  • Constructor Details

    • Member

      public Member(UUID playerUuid)
      Creates a Member instance for a specific player. If the member does not exist, one is created.
      Parameters:
      playerUuid - The uuid of the player
    • Member

      public Member(Player player)
      Creates a Member instance for a specific player. If the member does not exist, one is created.
      Parameters:
      player - The player
    • Member

      public Member(String redisKey)
      Creates a Member instance based on a known Member key. If the key does not exist, then a Member is created with this key.
      Parameters:
      redisKey - The redis key corresponding to this Member.
  • Method Details

    • cleanup

      public void cleanup()
      Cleans up all of the dangling redis keys corresponding to this member
    • getUniqueId

      public UUID getUniqueId()
      Gets the UUID for the player corresponding to this member.
      Specified by:
      getUniqueId in interface Player
      Returns:
      the uuid of the player.
    • getName

      public String getName()
      Gets the cached name of the member.
      Returns:
      the name of the member.
    • getPrefix

      public String getPrefix()
      Gets the cached prefix of the member.
      Returns:
      the prefix of the member.
    • getSuffix

      public String getSuffix()
      Gets the cached suffix of the member.
      Returns:
      the suffix of the member.
    • getFullName

      public String getFullName()
      Gets the full name of the member. This includes the `prefix + name + suffix`.
      Returns:
      the full name of the member.
    • getPartyKey

      public Optional<String> getPartyKey()
      Gets the redis key of the party that the member is in.
      Returns:
      the redis key for the party of the member, if the member is in a party, otherwise, empty Optional.
    • getParty

      public Optional<Party> getParty()
      Gets the Party for a player.
      Returns:
      the party corresponding to the player if the player is in a party, otherwise an empty Optional.
    • isInParty

      public boolean isInParty()
      Gets if the player is in a Party.
      Returns:
      true if the player is in a party. Otherwise, false.
    • setName

      public void setName(String name)
      Sets the name of the member.
      Parameters:
      name - The name of the member.
    • setPrefix

      public void setPrefix(String prefix)
      Sets the prefix of the member.
      Parameters:
      prefix - The prefix of the member.
    • setSuffix

      public void setSuffix(String suffix)
      Sets the suffix of the member.
      Parameters:
      suffix - The suffix of the member.
    • setPartyKey

      public void setPartyKey(String partyKey)
      Sets the current party key for the player.
      Parameters:
      partyKey - the party key to track as the current party.
    • leaveParty

      public void leaveParty()
      Leaves the current party of the member.