API
API for developers:
Example:
public void customFunction(Player player){
UUID id = player.getUniqueId();
if(xpbAPI.hasBoost(id)){
XPBoost xpb = xpbAPI.getBoost(id);
System.out.println("Player boost: " + xpb.getBoost());
System.out.println("Player boost duration: " + xpb.getBoostTime());
System.out.println("Time remaining: " + xpb.getTimeRemaining());
System.out.println("Boost end time (long): " + xpb.getEndTime());
System.out.println("List of conditions: " + xpb.getConditions());
}
}
SomeAPI:
xpbAPI.hasBoost(UUID id) /Returns Boolean
xpbAPI.setPlayerBoost(UUId id, double boost, int time) /Set XP Boost for a player
xpbAPI.getPlayerBoost(UUID id) /Returns players current XP boost
xpbAPI.clearBoost(UUID id) /Clears Boost from a player
xpbAPI.getTimeRemaining(UUID id) /Returns time remaining in seconds (if boost is not active then 0)
Comments