API
Here you can find possible interfaces from the CoinsAPI to be able to use them in your plugin.
To integrate the CoinsAPI into your project, you can place the .jar file in the recources
folder of your project and make this entry in the pom.xml
under the dependencies:
<dependency>
<groupId>de.herrtechniker</groupId>
<artifactId>CoinsAPI</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/CoinsAPI-1.0.0-SNAPSHOT-OBF.jar</systemPath>
</dependency>
CoinsAPI
To see if the player is already entered in the database, you can check it with the following query.
CoinsAPI().getAPI().isPlayerCoinsEntryExists(UUID uuid); //return boolean
Get the balance of a player.
CoinsAPI().getAPI().getCoins(UUID uuid); //return double
Set the account balance to a certain amount.
CoinsAPI().getAPI().setCoins(UUID uuid, double amount);
Remove a certain amount from a player's account.
CoinsAPI().getAPI().removeCoins(UUID uuid, double amount);
Add a certain amount to a player's account.
CoinsAPI().getAPI().addCoins(UUID uuid, double amount);
Reset a player's account balance.
CoinsAPI().getAPI().resetCoins(UUID uuid);
Set a player's account balance to a certain amount.
CoinsAPI().getAPI().resetCoins(UUID uuid, double amount);
Change a player's account balance to a certain amount.
CoinsAPI().getAPI().changeCoins(UUID uuid, double amount);
Namefetcher
To check whether a player's entry already exists, do the following.
LanguageAPI().getApi().isNamefetcherEntryExists(UUID uuid); // return boolean
To check whether a player's entry already exists, do the following.
LanguageAPI().getApi().isNamefetcherEntryExists(String name); // return boolean
To make an entry in the Namefetcher for a player, do the following.
Please note that there should ideally only be one entry per player
LanguageAPI().getApi().setNamefetcher(UUID uuid, String name);
To change a player's entry, for example if the player has changed their name, do the following.
LanguageAPI().getApi().changeNamefetcher(UUID uuid, String name);
To get the name of a player based on the UUID, do the following.
LanguageAPI().getApi().getName(UUID uuid); // return String
To get the UUID of a player by name, do the following.
LanguageAPI().getApi().getUUID(String name); // return UUID
Last updated