Interface IServerPartyAPI
- All Superinterfaces:
IPartyAPI
API for a party on the server side
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllyParty
(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.int
Gets 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.int
Gets the number of active invitation to this party.Gets a stream of all active invitations for this party.int
Gets 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.boolean
Checks whether the party with a specified UUID is allied by this one.boolean
Checks whether the player with a specified UUID has an active invitation to this party.void
removeAllyParty
(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.boolean
setRank
(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:IPartyAPI
Gets the number of members in this party.- Specified by:
getMemberCount
in interfaceIPartyAPI
- Returns:
- the member count
-
getMemberInfo
Description copied from interface:IPartyAPI
Gets info about the party member with a specified UUID.- Specified by:
getMemberInfo
in 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:IPartyAPI
Gets the number of parties allied by this one.- Specified by:
getAllyCount
in interfaceIPartyAPI
- Returns:
- the ally count
-
isAlly
Description copied from interface:IPartyAPI
Checks whether the party with a specified UUID is allied by this one. -
getInviteCount
int getInviteCount()Description copied from interface:IPartyAPI
Gets the number of active invitation to this party.- Specified by:
getInviteCount
in interfaceIPartyAPI
- Returns:
- the invite count
-
isInvited
Description copied from interface:IPartyAPI
Checks whether the player with a specified UUID has an active invitation to this party. -
getMemberInfoStream
Description copied from interface:IPartyAPI
Gets a stream of all member info for this party.- Specified by:
getMemberInfoStream
in interfaceIPartyAPI
- Returns:
- a
Stream
of all member info, not null
-
getStaffInfoStream
Description copied from interface:IPartyAPI
Gets a stream of all member info for the staff members of this party.- Specified by:
getStaffInfoStream
in interfaceIPartyAPI
- Returns:
- a
Stream
of all staff member info, not null
-
getNonStaffInfoStream
Description copied from interface:IPartyAPI
Gets a stream of all member info for the regular (non-staff) members of this party.- Specified by:
getNonStaffInfoStream
in interfaceIPartyAPI
- Returns:
- a
Stream
of all regular member info, not null
-
getInvitedPlayersStream
Description copied from interface:IPartyAPI
Gets a stream of all active invitations for this party.- Specified by:
getInvitedPlayersStream
in interfaceIPartyAPI
- Returns:
- a
Stream
of all active invitations, not null
-
getAllyPartiesStream
Description copied from interface:IPartyAPI
Gets a stream of UUIDs of all parties allied by this party.- Specified by:
getAllyPartiesStream
in interfaceIPartyAPI
- Returns:
- a
Stream
of all allies, not null
-
getOwner
Description copied from interface:IPartyAPI
Gets the member info for the owner of this party. -
getId
Description copied from interface:IPartyAPI
Gets the UUID of this party. -
getDefaultName
Description copied from interface:IPartyAPI
Gets the default name of this party.- Specified by:
getDefaultName
in 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:IPartyAPI
Sets 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
-