Official API of Rhenium
You can either shade this repository into your plugin, or run it as a plugin by itself.
- Clone this repository
- Enter the directory:
cd RheniumAPI - Build & install with Maven:
mvn clean install
OR
You can get Rhenium's API from the releases tab, then adding it through a libraries' folder:
<dependencies>
<dependency>
<groupId>org.neptune.rhenium</groupId>
<artifactId>Rhenium-API</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/libs/Rhenium.jar</systemPath>
</dependency>
</dependencies>There are currently only 2 methods to use.
Retrieving a player's profile and getting the credits of a player.
staticProfilegetProfile(Playerplayer)
staticintgetCredits(Playerplayer)The profile object methods are the following ones:
staticStringgetName()
staticintgetCredits()Example usage of Rhenium's API
Getting a player's credits on a listener.
@EventHandlerpublicvoidonPlayerChat(finalAsyncPlayerChatEventevent) {
if (event.getMessage() == "credits") {
event.setCancelled(true);
intcredits = RheniumAPI.getCredits(event.getPlayer());
event.getPlayer().sendMessage(ChatColor.translateAlternateChatColors('&', "&eYou have a total of &3&o" + credits + " &ecredits!"))
}
}