plugin-api
Versatile plugin utilities for your Spigot plugins in Kotlin:
- `type-safe builders of various API objects,
- concise event handling,
- GUI API and DSL,
- commands framework,
- minor language extensions,
- runtime bundling of kotlin-stdlib-jdk8, kotlin-reflect, and kotlinx-coroutines-core,
- JSON-based configuration API (Gson and Jackson from the box),
- coroutine dispatchers and asynchronous event handling.
Runtime
Download the
API runtime and put it into your /plugins/ folder alongside all plugins depending on it.
Compatibility with Spigot API
Most functionalities of the API was tested for 1.8.8 and even some hacks are made for compatibility with older versions; however, there still can be problems—report them, please.
Including
The library is divided into five modules with different purposes. You may include all the APIs you need; however, each module depends on common anyway.
There are snippets for Gradle and Maven build tools.
Gradle Groovy DSL
repositories {
mavenCentral()
maven { url '
https://gitlab.com/api/v4/projects/10077943/packages/maven' }
maven { url '
https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url '
https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
compileOnly 'io.github.commandertvis:chat-components:18.0.0'
compileOnly 'io.github.commandertvis:command:18.0.0'
compileOnly 'io.github.commandertvis:common:18.0.0'
compileOnly 'io.github.commandertvis:coroutines:18.0.0'
compileOnly 'io.github.commandertvis:gui:18.0.0'
}
Gradle Kotlin DSL
repositories {
mavenCentral()
maven("
https://gitlab.com/api/v4/projects/10077943/packages/maven")
maven("
https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("
https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT")
compileOnly("io.github.commandertvis:chat-components:18.0.0")
compileOnly("io.github.commandertvis:command:18.0.0")
compileOnly("io.github.commandertvis:common:18.0.0")
compileOnly("io.github.commandertvis:coroutines:18.0.0")
compileOnly("io.github.commandertvis:gui:18.0.0")
}
Maven POM
<repositories>
<repository>
<id>pluginApiGitlab</id>
<url>
https://gitlab.com/api/v4/projects/10077943/packages/maven</url>
</repository>
<repository>
<id>spigotNexus</id>
<url>
https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatypeOss</id>
<url>
https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigotApi.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.commandertvis.plugin</groupId>
<artifactId>common</artifactId>
<version>18.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.commandertvis.plugin</groupId>
<artifactId>command</artifactId>
<version>18.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.commandertvis.plugin</groupId>
<artifactId>coroutines</artifactId>
<version>18.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.commandertvis.plugin</groupId>
<artifactId>chat-components</artifactId>
<version>18.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.commandertvis.plugin</groupId>
<artifactId>gui</artifactId>
<version>${pluginApi.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Licensing
This project is licensed under the
MIT license.
Examples
Examples are published in the separate project:
CMDR_Tvis/plugin-api-examples>. Feel free to report
an issue to request an example for a certain API!
Documentation
API documentation is published
here.