Create an instance of EMCAPIClient like this
EMCAPIClient api = new EMCAPIClient();
Every method you should be using is within this class, there are Javadocs that you can read to learn how to use the library, the method names are self-explanatory
BASIC EXAMPLE: get the data of all currently registered players and print their username
public static void main(String[] args) {
EMCAPIClient api = new EMCAPIClient();
List<PlayerIdentifier> playerIdentifiers = api.getAllPlayerIdentifiers();
List<PlayerData> playerData = api.getPlayerDataByIdentifiers(playerIdentifiers);
int n = 1;
for (PlayerData player : playerData) {
System.out.println(n + ": " + player.getName());
n++;
}
}
Add EMCAPIClient to your Java project at https://jitpack.io/#jwkerr/EMCAPIClient
Replace "Tag" in the below examples with the latest Git commit hash (https://github.com/jwkerr/EMCAPIClient/commits/master/)
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.jwkerr</groupId>
<artifactId>EMCAPIClient</artifactId>
<version>Tag</version>
</dependency>
</dependencies>
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
implementation "com.github.jwkerr:EMCAPIClient:Tag"
}