Package net.ognetwork.ogcore.api.models
Class Member
java.lang.Object
net.ognetwork.ogcore.api.models.Member
- All Implemented Interfaces:
Player
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Cleans up all of the dangling redis keys corresponding to this memberGets the full name of the member.getName()
Gets the cached name of the member.getParty()
Gets the Party for a player.Gets the redis key of the party that the member is in.Gets the cached prefix of the member.Gets the cached suffix of the member.Gets the UUID for the player corresponding to this member.boolean
Gets if the player is in a Party.void
Leaves the current party of the member.void
Sets the name of the member.void
setPartyKey
(String partyKey) Sets the current party key for the player.void
Sets the prefix of the member.void
Sets the suffix of the member.
-
Constructor Details
-
Member
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
Creates a Member instance for a specific player. If the member does not exist, one is created.- Parameters:
player
- The player
-
Member
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
Gets the UUID for the player corresponding to this member.- Specified by:
getUniqueId
in interfacePlayer
- Returns:
- the uuid of the player.
-
getName
Gets the cached name of the member.- Returns:
- the name of the member.
-
getPrefix
Gets the cached prefix of the member.- Returns:
- the prefix of the member.
-
getSuffix
Gets the cached suffix of the member.- Returns:
- the suffix of the member.
-
getFullName
Gets the full name of the member. This includes the `prefix + name + suffix`.- Returns:
- the full name of the member.
-
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
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
Sets the name of the member.- Parameters:
name
- The name of the member.
-
setPrefix
Sets the prefix of the member.- Parameters:
prefix
- The prefix of the member.
-
setSuffix
Sets the suffix of the member.- Parameters:
suffix
- The suffix of the member.
-
setPartyKey
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.
-