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

FriendSystemAPI api = FriendSystem.getAPI();

FriendManager

The FriendManager provides functionality related to managing friends and their interactions. You can retrieve the FriendManagerby using:

IFriendManager friendManager = api.getFriendManagerAPI();

You can use the FriendManager for the following:

Retrieve a FriendPlayer
IFriendPlayer getFriendPlayer(String uuidOrName);
Toggle friend invites
void toggleInvites(IFriendPlayer player);
Toggle private messages
void toggleMsgs(IFriendPlayer player);
Toggle join/leave notifies
void toggleNotifies(IFriendPlayer player);
Toggle the option allowing a player to be "jumped to"
void toggleJumping(IFriendPlayer player);
Update the status message
updateStatus(IFriendPlayer player, String status);
Send a friend request
addFriendRequest(IFriendPlayer requester, IFriendPlayer target);
Accept a friend request
acceptFriendRequest(IFriendPlayer accepter, IFriendPlayer requester);
Deny friend request
denyFriendRequest(IFriendPlayer denier, IFriendPlayer requester);
Remove a friend
removeFriend(IFriendPlayer remover, IFriendPlayer removed);
Mark/unmark a friend as favourite
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
String getName();
Check if the player allows friend invites
boolean isInvitesAllowed();
Check if messages are allowed
boolean isMsgsAllowed();
Check if the player jumping to their server
boolean isJumpingAllowed();
Get the last date when the player logged in or out
LocalDateTime getLastSeen();
Retrieves the current status of the player
String getStatus();
Retrieves the list of all friends. The boolean indicates if the friend is marked as favourite
HashMap<String, Boolean> getFriends();
Retrieves the list of online friends. The boolean indicates if the friend is marked as favourite
HashMap<ProxiedPlayer, Boolean> getOnlineFriends();
Retrieves the list of offline friends. The boolean indicates if the player is marked as favourite
HashMap<String, Boolean> getOfflineFriends();
Check if the friend player is friends with another player
boolean isFriendsWith(String uuid);
Check if the friend player has received a friend request from a player
boolean isRequestedBy(String uuid);
Retrieves the list of all pending friend requests
ArrayList<String> getRequests();

PartyManager

The PartyManager provides functionality related to managing or retrieving parties.

Get instance of PartyManager
IPartyManager partyManager = api.getPartyManagerAPI();

You can use the PartyManager for the following:

Retrieve a Party from a player
IParty getPartyFromPlayer(ProxiedPlayer);
Create a party
void addParty(IParty party);
Close a party
void removeParty(IParty party);
Invite a player to a party
void invitePlayer(IParty party, ProxiedPlayer player);
Remove a party invite
void removeInvite(IParty party, ProxiedPlayer player);
add a player to a party
addPlayer(IParty party, ProxiedPlayer player);
kick a player from a party
kickPlayer(IParty party, ProxiedPlayer player);
promote a player to the next rank in a party
promotePlayer(IParty party, ProxiedPlayer player);
demote a player to the next rank in a party
demotePlayer(IParty party, ProxiedPlayer player);
set a new random leader for a party
setNewLeader(IParty party);
set a new specific leader for a party
setNewLeader(IParty party, ProxiedPlayer player);

IParty

The IPartyrepresents a party within the Friend System. You can retrieve the following informations from a IParty

Get the id of the party
int getPartyId();
Get the leader
ProxiedPlayer getLeader();
Get a list of the moderators
List<ProxiedPlayer> getModerators();
get a list of all players
List<ProxiedPlayer> getPlayers();
Get a list of the requests
List<ProxiedPlayer> getInvites();
get a list of all players (leader, moderators, players)
List<ProxiedPlayer> getAllPlayers();
check if a player is part of a party
boolean containsPlayer(ProxiedPlayer player);
Returns leader, moderator or player
String getRole(ProxiedPlayer);
get the prefix of a specific group in a party
String getPrefixOfGroup(String group);
broadcast a message to all players in the party
void broadcastMessage(BaseComponent[] baseComponents);

Last updated