DeveloperAPI
I've never coded an API before so I am aware that this could be coded a lot better!
The class that you will only need to import will be XyploEconomyAPI which the import of that class is pub.xyplo.economy.api just in case you were wondering. In this API you can do the following:
- Check if a player has an account (Although this doesn't return anything until it has a purpose).
- Set the points of a player. (Which will return the points you set).
- Give the player some points on top of their current points. (Which will return their newly updated points).
- Take points from a player. (Which will return their newly updated points).
- Get the points of a player. (Which will return their current points).
- Pay players. (Which will return the points payed).
Examples
The sender doesn't need a permission!
setPoints
XyploEconomyAPI.setPoints(sender, player, points); The points will most probably be wrapped in an Integer.parseInt(); format.
returns the players updated points.
givePoints
XyploEconomyAPI.givePoints(sender, player, points); The points will most probably be wrapped in an Integer.parseInt(); format.
returns the players updated points.
takePoints
XyploEconomyAPI.takePoints(sender, player, points); The points will most probably be wrapped in an Integer.parseInt(); format.
returns the players updated points.
getMoney
XyploEconomyAPI.getMoney(sender, player); The player will be the player that your are getting the money of.
returns the points of the player.
payMoney
XyploEconomyAPI.payMoney(sender, player, points); In this case the sender is the player that is paying the money and the player is the person that is receiving the money.
returns the points that sender is sending.
Comments