API
How do I hook into Buddies?
Simple! All you need to do is get the plugin then get the buddy manager. Like so:
Buddies budPlug = (Buddies) getServer().getPluginManager().getPlugin("Buddies"); BuddyManager buddyManager = budPlug.getBuddyManager();
Checking if are buddies:
boolean areBuds = buddyManager.areBuddies("firstName", "secondName");
Getting buddy list:
BuddyList myBudList = buddyManager.getBuddyList("yourName");
Adding buddies to player:
if(!myBudList.isBuddy("budsName")) { myBudList.addBuddy("budsName"); myBudList.getBuddy("budsName").setAccepted(true); myBudList.save(); budsBudList.addBuddy("yourName"); budsBudList.getBuddy("yourName").setAccepted(true); budsBudList.save(); }
Comments