Kotlin Plugin
Provides Kotlin libs and some features for building awesome Kotlin plugins.
Can be used instead of CreeperFace's KotlinLib (don't use together!)
Included Libraries
Kotlin
- kotlin-stdlib
- kotlin-stdlib-jdk7
- kotlin-stdlib-jdk8
- kotlin-reflect
- kotlinx-coroutines-core
- kotlinx-serialization-core
- kotlinx-serialization-json
- kotlinx-serialization-protobuf
- kotlinx-serialization-cbor
- kotlinx-serialization-properties
- kotlinx-datetime
- kotlinx-collections-immutable
- okio
- knbt
- kaml
- ktor-io
- ktor-utils
- ktor-network
- ktor-network-tls
- ktor-http
- ktor-http-cio
- ktor-client-core
- ktor-client-cio
- ktor-client-json
- ktor-client-gson
- ktor-client-serialization
- MichaelBull's kotlin-inline-logger
Java
How to use in your plugin
Add this dependency to your plugin.yml
file (required):
depend:
- KotlinLib
Add a library dependency to your project using the examples bellow (recommended).
Make your plugin class extend KotlinPluginBase
(optional).
Note: We haven't published to the maven central yet, but the snapshots are available at Sonatype OSS snapshots repository.
Gradle (Kotlin DSL)
repositories {
maven(url="https://oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
implementation("org.powernukkit:powernukkit:1.5.1.0-PN")
implementation("org.powernukkit.plugins:kotlin-plugin-lib:1.5.31+0.1.0+2021.10.5-SNAPSHOT")
}
Gradle (Groovy DSL)
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
implementation 'org.powernukkit:powernukkit:1.5.1.0-PN'
implementation 'org.powernukkit.plugins:kotlin-plugin-lib:1.5.31+0.1.0+2021.10.5-SNAPSHOT'
}
Maven
<repositories>
<repository>
<id>sonatype-oss-snapshotsid>
<url>https://oss.sonatype.org/content/repositories/snapshots/url>
repository>
repositories>
<dependencies>
<dependency>
<groupId>org.powernukkitgroupId>
<artifactId>powernukkitartifactId>
<version>1.5.1.0-PNversion>
dependency>
<dependency>
<groupId>org.powernukkit.pluginsgroupId>
<artifactId>kotlin-plugin-libartifactId>
<version>1.5.31+0.1.0+2021.10.5-SNAPSHOTversion>
dependency>
dependencies>
Cloning and importing
- Just do a normal
git clone https://github.com/PowerNukkit/KotlinPlugin.git
(or the URL of your own git repository) - Import the
build.gradle.kts
file with your IDE, it should do the rest by itself
Running
- Just do a normal
git clone https://github.com/PowerNukkit/KotlinPlugin.git
(or the URL of your own git repository) cd KotlinPlugin
(or the name of your project)./gradlew run
Debugging
- Import the project into your IDE
- Make your IDE run the
debug
gradle task in debug mode