Interface PartyManager
public interface PartyManager
Prodrivers Commons Party Manager.
Allows interacting with Prodrivers Commons global parties. Invites, kick, disband and others are directly handled by the plugin.
Used implementation can be changed in configuration.
-
Method Summary
Modifier and TypeMethodDescriptionvoidInvites a player to a partyvoidaddPartyInvite(@NonNull UUID invitedPlayerUniqueId, @NonNull Party party) Invites a player to a partybooleanaddToParty(@NonNull Party party, @NonNull UUID playerUniqueId) Assigns an existing party to a player.booleanassignOwner(@NonNull Party party, @NonNull UUID newOwnerUniqueId) Assigns a new owner to a party.createParty(@NonNull UUID ownerUniqueId) Creates a new party.voidDisband and remove a party.Returns all known parties.Get player's party.getPartyInvites(@NonNull UUID invitedPlayerUniqueId) Get parties on which the player has pending party invitations.booleanhasPartyInvites(@NonNull UUID invitedPlayerUniqueId) Checks if the player has pending party invitations.booleanInvites a player to a partybooleanChecks if given player is in a party.booleanremoveFromParty(@NonNull UUID playerUniqueId) Removes existing party from the manager.voidremovePartyInvites(@NonNull UUID invitedPlayerUniqueId) Removes all pending party invitations for a player.
-
Method Details
-
isInParty
Checks if given player is in a party.- Parameters:
playerUniqueId- Player unique ID- Returns:
trueif the player is in a party
-
getParty
Get player's party.- Parameters:
playerUniqueId- Player Unique ID- Returns:
- Player's party
-
getParties
Returns all known parties.- Returns:
- Parties
-
createParty
Creates a new party.- Parameters:
ownerUniqueId- Party owner- Returns:
- New party instance
-
addToParty
Assigns an existing party to a player.- Parameters:
party- Party to add player toplayerUniqueId- Player's UniqueId- Returns:
trueif player was added to party
-
removeFromParty
Removes existing party from the manager.- Parameters:
playerUniqueId- Player's UniqueId- Returns:
trueif player was removed from party
-
disband
Disband and remove a party.- Parameters:
party- Party to disband
-
invite
boolean invite(@NonNull UUID inviterPlayerUniqueId, @NonNull UUID invitedPlayerUniqueId) throws PlayerNotConnectedException, PartyCannotInviteYourselfException Invites a player to a party- Parameters:
inviterPlayerUniqueId- Inviter playerinvitedPlayerUniqueId- Invited player- Returns:
trueif invite was sent with success- Throws:
PlayerNotConnectedException- Inviter or invited player ID is invalid or not connectedPartyCannotInviteYourselfException- Player trie sto invite itself
-
accept
void accept(@NonNull UUID inviterPlayerUniqueId, @NonNull UUID invitedPlayerUniqueId) throws PlayerNotConnectedException, PlayerNotInvitedToParty Invites a player to a party- Parameters:
inviterPlayerUniqueId- Inviter playerinvitedPlayerUniqueId- Invited player- Throws:
PlayerNotConnectedException- Inviter or invited player ID is invalid or not connectedPlayerNotInvitedToParty- Player is not invited to party
-
assignOwner
Assigns a new owner to a party.- Parameters:
party- Party to assign owner tonewOwnerUniqueId- New owner's Unique ID- Returns:
trueif new owner was assigned
-
addPartyInvite
Invites a player to a party- Parameters:
invitedPlayerUniqueId- Invited playerparty- Associated party
-
hasPartyInvites
Checks if the player has pending party invitations.- Parameters:
invitedPlayerUniqueId- Invited player's Unique ID- Returns:
trueif the player has pending party invites.
-
getPartyInvites
Get parties on which the player has pending party invitations.- Parameters:
invitedPlayerUniqueId- Invited player's Unique ID- Returns:
- Parties that sent an invitation to the specified player
-
removePartyInvites
Removes all pending party invitations for a player.- Parameters:
invitedPlayerUniqueId- Invited player's Unique ID
-