Source of AdvancedServerList's API
AdvancedServerList API
The AdvancedServerList API is used to interact with the plugin AdvancedServerList, allowing you to do things such as modifying different aspects of the displayed Server List.
Table of Contents
Security
Please see the SECURITY.md file for currently supported versions of this API.
Install
Detailed instructions on how to install and use this API are found here.
Below is a basic example of integrating it into your pom.xml or build.gradle (Replace {version} with the latest available one).
Maven
<repositories>
<repository>
<id>codeberg</id>
<url>https://codeberg.org/api/packages/Andre601/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>api</artifactId>
<version>{version}</version>
<scope>provided</scope>
</dependency>
<!-- Optional Dependencies -->
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-bukkit</artifactId>
<version>{version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-bungeecord</artifactId>
<version>{version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-velocity</artifactId>
<version>{version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Gradle
repositories {
maven { url = "https://codeberg.org/api/packages/Andre601/maven" }
}
dependencies {
compileOnly "ch.andre601.asl-api:api:{version}"
// Optional Dependencies
compileOnly "ch.andre601.asl-api:platform-bukkit:{version}"
compileOnly "ch.andre601.asl-api:platform-bungeecord:{version}"
compileOnly "ch.andre601.asl-api:platform-velocity:{version}"
}
Usage
Using the API is explained in the main Wiki.
Below is a basic example of creating your own PlaceholderProvider and registering it.
PlaceholderProvider Example
publicclass ExamplePlaceholderextendsPlaceholderProvider{publicExamplePlaceholder(){super("example")}@OverridepublicStringparsePlaceholder(Stringtext,GenericPlayerplayer,GenericServerserver){if(text.equalsIgnoreCase("hello")){return"world!";}returnnull;}}Registering PlaceholderProvider
Note
The example below uses a Bukkit-plugin Setup as example.
publicclass MyPluginextendsJavaPlugin{@OverridepublicvoidonEnable(){if(Bukkit.getPluginManager().isPluginEnabled("AdvancedServerList")){AdvancedServerListAPI.get().addPlaceholderProvider(newExamplePlaceholder());}}}License
AdvancedServerList API is licensed under MIT. See the LICENSE file for the full License text.