Interface IServerPartyAPI
- All Superinterfaces:
IPartyAPI
API for a party on the server side
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllyParty(UUID partyId) Adds a new ally party to this party.addMember(UUID playerUUID, xaero.pac.common.parties.party.member.PartyMemberRank rank, String playerUsername) Adds a new party member with specified player UUID, rank and username.intGets the number of parties allied by this one.Gets a stream of UUIDs of all parties allied by this party.Gets the default name of this party.getId()Gets the UUID of this party.intGets the number of active invitation to this party.Gets a stream of all active invitations for this party.intGets the number of members in this party.getMemberInfo(String username) Gets info about the party member with a specified username.getMemberInfo(UUID memberUUID) Gets info about the party member with a specified UUID.Gets a stream of all member info for this party.Gets a stream of all member info for the regular (non-staff) members of this party.Stream<net.minecraft.server.level.ServerPlayer>Gets a stream of all currently online members of this party.getOwner()Gets the member info for the owner of this party.Gets a stream of all member info for the staff members of this party.invitePlayer(UUID playerUUID, String playerUsername) Invites the player with specified player UUID and username to this party.booleanChecks whether the party with a specified UUID is allied by this one.booleanChecks whether the player with a specified UUID has an active invitation to this party.voidremoveAllyParty(UUID partyId) Removes an ally party from this party.removeMember(UUID playerUUID) Removes the party member with a specified player UUID, unless the player is the owner of this party.booleansetRank(IPartyMemberAPI member, xaero.pac.common.parties.party.member.PartyMemberRank rank) Sets the rank of a specified party member.uninvitePlayer(UUID playerUUID) Removes the player invitation for a specified player UUID.
-
Method Details
-
getMemberCount
int getMemberCount()Description copied from interface:IPartyAPIGets the number of members in this party.- Specified by:
getMemberCountin interfaceIPartyAPI- Returns:
- the member count
-
getMemberInfo
Description copied from interface:IPartyAPIGets info about the party member with a specified UUID.- Specified by:
getMemberInfoin interfaceIPartyAPI- Parameters:
memberUUID- the UUID of a party member, not null- Returns:
- the member info, null if doesn't exist
-
getAllyCount
int getAllyCount()Description copied from interface:IPartyAPIGets the number of parties allied by this one.- Specified by:
getAllyCountin interfaceIPartyAPI- Returns:
- the ally count
-
isAlly
Description copied from interface:IPartyAPIChecks whether the party with a specified UUID is allied by this one. -
getInviteCount
int getInviteCount()Description copied from interface:IPartyAPIGets the number of active invitation to this party.- Specified by:
getInviteCountin interfaceIPartyAPI- Returns:
- the invite count
-
isInvited
Description copied from interface:IPartyAPIChecks whether the player with a specified UUID has an active invitation to this party. -
getMemberInfoStream
Description copied from interface:IPartyAPIGets a stream of all member info for this party.- Specified by:
getMemberInfoStreamin interfaceIPartyAPI- Returns:
- a
Streamof all member info, not null
-
getStaffInfoStream
Description copied from interface:IPartyAPIGets a stream of all member info for the staff members of this party.- Specified by:
getStaffInfoStreamin interfaceIPartyAPI- Returns:
- a
Streamof all staff member info, not null
-
getNonStaffInfoStream
Description copied from interface:IPartyAPIGets a stream of all member info for the regular (non-staff) members of this party.- Specified by:
getNonStaffInfoStreamin interfaceIPartyAPI- Returns:
- a
Streamof all regular member info, not null
-
getInvitedPlayersStream
Description copied from interface:IPartyAPIGets a stream of all active invitations for this party.- Specified by:
getInvitedPlayersStreamin interfaceIPartyAPI- Returns:
- a
Streamof all active invitations, not null
-
getAllyPartiesStream
Description copied from interface:IPartyAPIGets a stream of UUIDs of all parties allied by this party.- Specified by:
getAllyPartiesStreamin interfaceIPartyAPI- Returns:
- a
Streamof all allies, not null
-
getOwner
Description copied from interface:IPartyAPIGets the member info for the owner of this party. -
getId
Description copied from interface:IPartyAPIGets the UUID of this party. -
getDefaultName
Description copied from interface:IPartyAPIGets the default name of this party.- Specified by:
getDefaultNamein interfaceIPartyAPI- Returns:
- the default name, not null
-
setRank
boolean setRank(@Nonnull IPartyMemberAPI member, @Nonnull xaero.pac.common.parties.party.member.PartyMemberRank rank) Description copied from interface:IPartyAPISets the rank of a specified party member.The member info needs to be from this party.
-
addMember
@Nullable IPartyMemberAPI addMember(@Nonnull UUID playerUUID, @Nullable xaero.pac.common.parties.party.member.PartyMemberRank rank, @Nonnull String playerUsername) Adds a new party member with specified player UUID, rank and username.- Parameters:
playerUUID- the UUID of a player, not nullrank- the rank for the party member, null for the default rankplayerUsername- the current username of the player, not null- Returns:
- the created party member info, null if the player is already in a party
-
removeMember
Removes the party member with a specified player UUID, unless the player is the owner of this party.- Parameters:
playerUUID- the UUID of a player, not null- Returns:
- the removed party member info, null if the specified player is the party owner or if the player isn't in the party
-
getMemberInfo
Gets info about the party member with a specified username.- Parameters:
username- the username of a party member, not null- Returns:
- the member info, null if doesn't exist
-
addAllyParty
Adds a new ally party to this party.- Parameters:
partyId- the UUID of the party to ally, not null
-
removeAllyParty
Removes an ally party from this party.- Parameters:
partyId- the UUID of the party to unally, not null
-
invitePlayer
@Nullable IPartyPlayerInfoAPI invitePlayer(@Nonnull UUID playerUUID, @Nonnull String playerUsername) Invites the player with specified player UUID and username to this party.- Parameters:
playerUUID- the UUID of the player, not nullplayerUsername- the current username of the player, not null- Returns:
- the invitation info, null if the player is already invited to this party
-
uninvitePlayer
Removes the player invitation for a specified player UUID.- Parameters:
playerUUID- the UUID of the player, not null- Returns:
- the removed invitation info, null if the player has not been invited
-
getOnlineMemberStream
Gets a stream of all currently online members of this party.- Returns:
- the stream of online party members, not null
-