Skip to content

Latest commit

 

History

History
63 lines (53 loc) · 1.54 KB

README.md

File metadata and controls

63 lines (53 loc) · 1.54 KB

EMCAPIClient

Using EMCAPIClient

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++;
    }
}

Adding EMCAPIClient to your project

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/)

Maven

<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>

Gradle

repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}
dependencies {
        implementation "com.github.jwkerr:EMCAPIClient:Tag"
}