To use the API, simply add the 'FriendSystem-Spigot-API.jar' to your project.
You also need to put the FriendSystem-Spigot-API.jar in your plugins folder of your minecraft server and enter your MySQL data in the database.yml file.
The MySQL credentials must be the same, as on the bungeecord / velocity server.
You can then access the API through
Copy SpigotAPI api = SpigotAPI . getInstance ();
FriendManager
The FriendManager
provides functionality related to managing friends and their interactions.
You can retrieve the FriendManager
by using:
Copy FriendManager friendManager = api . getFriendManager ();
You can use the FriendManager
for the following:
Retrieve a FriendPlayer from MySQL async
Copy void getFriendPlayer( UUID uuid , Consumer< FriendPlayer > friendPlayer) ;
Retrieve a FriendPlayer from MySQL async
Copy void getFriendPlayer( String name , Consumer< FriendPlayer > friendPlayer) ;
Retrieve a FriendPlayer from MySQL
Copy FriendPlayer getFriendPlayer( UUID uuid) ;
Retrieve a FriendPlayer from MySQL
Copy FriendPlayer getFriendPlayer( String name) ;
Copy void toggleInvites( FriendPlayer player) ;
Copy void toggleMsgs( FriendPlayer player) ;
Toggle join/leave notifications
Copy void toggleNotifies( FriendPlayer player) ;
Toggle the option allowing a player to be "jumped to"
Copy void toggleJumping( FriendPlayer player) ;
Toggle the last seen / online since visibility
Copy void toggleLastSeen( FriendPlayer player) ;
Copy void toggleShowServer( FriendPlayer player) ;
Copy void togglePartyInvites( FriendPlayer player) ;
Update the status message
Copy updateStatus( FriendPlayer player , String status) ;
Copy addFriendRequest( Player sender , UUID receiver) ;
Copy acceptFriendRequest( Player sender , UUID receiver) ;
Copy denyFriendRequest( Player denier , UUID requester) ;
Copy removeFriend( Player remover , UUID removed) ;
Mark/unmark a friend as favourite
Copy toggleFavouriteFriend( Player sender , UUID favourite) ;
FriendPlayer
The FriendPlayer
represents a player within the Friend System.
You can retrieve the following informations from a FriendPlayer
Retrieve name of the player
Copy String getName() ;
Check if the player allows friend invites
Copy boolean isInvitesAllowed() ;
Get Messages State. States are ENABLED, DISABLED and FRIENDS_ONLY
Copy boolean getMsgsState() ;
Check if the player jumping to their server
Copy boolean isJumpingAllowed() ;
Check if last seen / online since is visible
Copy boolean isShowLastSeen() ;
Check if server is visible
Copy boolean isShowServer() ;
Get Party Invites State. States are ENABLED, DISABLED and FRIENDS_ONLY
Copy SettingState getPartyInvitesState() ;
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 PartyManager partyManager = api . getPartyManager ();
You can use the PartyManager for the following:
Retrieve a Party from MySQL async
Copy void getParty( UUID player , Consumer< Party > party) ;
Retrieve a Party from MySQL
Copy Party getParty( UUID player) ;
Get a List of all Parties from MySQL async
Copy void getAllParties( Consumer<List< Party >> parties) ;
Get a List of all Parties from MySQL
Copy List< Party > getAllParties() ;
Copy void createParty( Player leader , String ... memberUUIDs )
Copy void disbandParty( Player leader) ;
Invite a player to a party
Copy void invitePlayer( UUID leader , Player player) ;
Copy void removeInvite( UUID leader , Player player) ;
Copy addPlayer( UUID leader , Player player) ;
kick a player from a party
Copy kickPlayer( UUID leader , Player player) ;
promote a player to the next rank in a party
Copy promotePlayer( UUID leader , Player player) ;
demote a player to the next rank in a party
Copy demotePlayer( UUID leader , Player player) ;
Party
The Party
represents a party within the Friend System.
You can retrieve the following informations from a Party
Copy UUID getLeaderUUID() ;
Get a list of the members (only players)
Copy List<UUID> getMemberUUIDs();
get a list of all members (leader, moderators, players)
Copy List<UUID> getAllMembers();