Hook into LastLoginAPI
LastLoginAPI offers some API to work with. They are currently under development.
Importing LastLoginAPI
Maven
<repositories>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.alessiodp.lastloginapi</groupId>
<artifactId>lastloginapi-api</artifactId>
<version>1.3.4</version>
</dependency>
</dependencies>
Gradle
repositories {
maven {
name = 'codemc-repo'
url = 'https://repo.codemc.org/repository/maven-public/'
}
}
dependencies {
compileOnly group: 'com.alessiodp.lastloginapi', name: 'lastloginapi-api', version: '1.3.4'
}
Implementing LastLoginAPI
Open plugin.yml
and insert LastLoginAPI
as depend (or soft-depend):
depend: [LastLoginAPI]
soft-depend: [LastLoginAPI]
Before hook into it, be sure its enabled!
if (getServer().getPluginManager().getPlugin("LastLoginAPI") != null) {
if (getServer().getPluginManager().getPlugin("LastLoginAPI").isEnabled()) {
// LastLoginAPI is enabled
}
}
API Methods
LastLoginAPI offers a class called LastLoginAPI
, you can initialize it to call API methods. This is how you can use it:
LastLoginAPI api = LastLogin.getApi();
LLPlayer player = api.getLLPlayer(simplePlayer.getUniqueId()); // Get the player
String name = player.getName(); // Get the name
You can read about events here.
Javadoc
You can find the Javadoc here.