Skip to content

Java library for simplifying interactions with EarthMC's API

Notifications You must be signed in to change notification settings

jwkerr/EMCAPIClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Java library for simplifying interactions with EarthMC's API

Resources

Stars

Watchers

Forks

Languages