Developer API
The plugin offers a complete developer Spigot API, which allows other plugins on the server to manage friends, parties, settings and much more.
Last updated
The plugin offers a complete developer Spigot API, which allows other plugins on the server to manage friends, parties, settings and much more.
Last updated
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
SpigotAPI api = SpigotAPI.getInstance();
The FriendManager
provides functionality related to managing friends and their interactions.
You can retrieve the FriendManager
by using:
FriendManager friendManager = api.getFriendManager();
You can use the FriendManager
for the following:
void getFriendPlayer(UUID uuid, Consumer<FriendPlayer> friendPlayer);
void getFriendPlayer(String name, Consumer<FriendPlayer> friendPlayer);
FriendPlayer getFriendPlayer(UUID uuid);
FriendPlayer getFriendPlayer(String name);
void toggleInvites(FriendPlayer player);
void toggleMsgs(FriendPlayer player);
void toggleNotifies(FriendPlayer player);
void toggleJumping(FriendPlayer player);
void toggleLastSeen(FriendPlayer player);
void toggleShowServer(FriendPlayer player);
void togglePartyInvites(FriendPlayer player);
updateStatus(FriendPlayer player, String status);
addFriendRequest(Player sender, UUID receiver);
acceptFriendRequest(Player sender, UUID receiver);
denyFriendRequest(Player denier, UUID requester);
removeFriend(Player remover, UUID removed);
toggleFavouriteFriend(Player sender, UUID favourite);
The FriendPlayer
represents a player within the Friend System.
You can retrieve the following informations from a FriendPlayer
String getName();
boolean isInvitesAllowed();
boolean getMsgsState();
boolean isJumpingAllowed();
boolean isShowLastSeen();
boolean isShowServer();
SettingState getPartyInvitesState();
LocalDateTime getLastSeen();
String getStatus();
HashMap<String, Boolean> getFriends();
HashMap<ProxiedPlayer, Boolean> getOnlineFriends();
HashMap<String, Boolean> getOfflineFriends();
boolean isFriendsWith(String uuid);
boolean isRequestedBy(String uuid);
ArrayList<String> getRequests();
The PartyManager
provides functionality related to managing or retrieving parties.
PartyManager partyManager = api.getPartyManager();
You can use the PartyManager for the following:
void getParty(UUID player, Consumer<Party> party);
Party getParty(UUID player);
void getAllParties(Consumer<List<Party>> parties);
List<Party> getAllParties();
void createParty(Player leader, String... memberUUIDs)
void disbandParty(Player leader);
void invitePlayer(UUID leader, Player player);
void removeInvite(UUID leader, Player player);
addPlayer(UUID leader, Player player);
kickPlayer(UUID leader, Player player);
promotePlayer(UUID leader, Player player);
demotePlayer(UUID leader, Player player);
The Party
represents a party within the Friend System.
You can retrieve the following informations from a Party
int getPartyId();
UUID getLeaderUUID();
List<UUID> getMemberUUIDs();
List<UUID> getAllMembers();