Developer API The plugin offers a complete developer BungeeCord/Velocity API, which allows other plugins on the server to manage friends, parties, settings and much more.
To use the API, simply add the 'FriendSystem-Velocity.jar' or 'FriendSystem-Bungee.jar' to your project.
You can then access the API through
Copy FriendSystemAPI api = FriendSystem . getAPI ();
FriendManager
The FriendManager
provides functionality related to managing friends and their interactions.
You can retrieve the FriendManager
by using:
Copy IFriendManager friendManager = api . getFriendManagerAPI ();
You can use the FriendManager
for the following:
Copy IFriendPlayer getFriendPlayer( String uuidOrName) ;
Copy void toggleInvites( IFriendPlayer player) ;
Copy void toggleMsgs( IFriendPlayer player) ;
Toggle join/leave notifies
Copy void toggleNotifies( IFriendPlayer player) ;
Toggle the option allowing a player to be "jumped to"
Copy void toggleJumping( IFriendPlayer player) ;
Update the status message
Copy updateStatus( IFriendPlayer player , String status) ;
Copy addFriendRequest( IFriendPlayer requester , IFriendPlayer target) ;
Copy acceptFriendRequest( IFriendPlayer accepter , IFriendPlayer requester) ;
Copy denyFriendRequest( IFriendPlayer denier , IFriendPlayer requester) ;
Copy removeFriend( IFriendPlayer remover , IFriendPlayer removed) ;
Mark/unmark a friend as favourite
Copy toggleFavouriteFriend( IFriendPlayer remover , IFriendPlayer removed) ;
FriendPlayer
The IFriendPlayer
represents a player within the Friend System.
You can retrieve the following informations from a IFriendPlayer
Retrieve name of the player
Copy String getName() ;
Check if the player allows friend invites
Copy boolean isInvitesAllowed() ;
Check if messages are allowed
Copy boolean isMsgsAllowed() ;
Check if the player jumping to their server
Copy boolean isJumpingAllowed() ;
Get the last date when the player logged in or out
Copy LocalDateTime getLastSeen() ;
Retrieves the current status of the player
Copy String getStatus() ;
Retrieves the list of all friends. The boolean indicates if the friend is marked as favourite
Copy HashMap< String , Boolean > getFriends() ;
Retrieves the list of online friends. The boolean indicates if the friend is marked as favourite
Copy HashMap< ProxiedPlayer , Boolean > getOnlineFriends() ;
Retrieves the list of offline friends. The boolean indicates if the player is marked as favourite
Copy HashMap< String , Boolean > getOfflineFriends() ;
Check if the friend player is friends with another player
Copy boolean isFriendsWith( String uuid) ;
Check if the friend player has received a friend request from a player
Copy boolean isRequestedBy( String uuid) ;
Retrieves the list of all pending friend requests
Copy ArrayList< String > getRequests() ;
PartyManager
The PartyManager
provides functionality related to managing or retrieving parties.
Get instance of PartyManager
Copy IPartyManager partyManager = api . getPartyManagerAPI ();
You can use the PartyManager for the following:
Retrieve a Party from a player
Copy IParty getPartyFromPlayer(ProxiedPlayer) ;
Copy void addParty( IParty party) ;
Copy void removeParty( IParty party) ;
Invite a player to a party
Copy void invitePlayer( IParty party , ProxiedPlayer player) ;
Copy void removeInvite( IParty party , ProxiedPlayer player) ;
Copy addPlayer( IParty party , ProxiedPlayer player) ;
kick a player from a party
Copy kickPlayer( IParty party , ProxiedPlayer player) ;
promote a player to the next rank in a party
Copy promotePlayer( IParty party , ProxiedPlayer player) ;
demote a player to the next rank in a party
Copy demotePlayer( IParty party , ProxiedPlayer player) ;
set a new random leader for a party
Copy setNewLeader( IParty party) ;
set a new specific leader for a party
Copy setNewLeader( IParty party , ProxiedPlayer player) ;
IParty
The IParty
represents a party within the Friend System.
You can retrieve the following informations from a IParty
Copy ProxiedPlayer getLeader() ;
Get a list of the moderators
Copy List< ProxiedPlayer > getModerators() ;
get a list of all players
Copy List< ProxiedPlayer > getPlayers() ;
Get a list of the requests
Copy List< ProxiedPlayer > getInvites() ;
get a list of all players (leader, moderators, players)
Copy List< ProxiedPlayer > getAllPlayers() ;
check if a player is part of a party
Copy boolean containsPlayer( ProxiedPlayer player) ;
Returns leader, moderator or player
Copy String getRole(ProxiedPlayer) ;
get the prefix of a specific group in a party
Copy String getPrefixOfGroup( String group) ;
broadcast a message to all players in the party
Copy void broadcastMessage( BaseComponent [] baseComponents) ;
Last updated 5 months ago