From 1ac84605d674facb1c80bc0b48192e7ae5a73649 Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Mon, 12 Oct 2020 17:21:40 +0200 Subject: [PATCH] Update readme.md --- readme.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 98227a29..245c2ea3 100644 --- a/readme.md +++ b/readme.md @@ -69,10 +69,66 @@ implementation 'net.axay:KSpigot:VERSION_HERE' If you work with KSpigot, you also need Spigot as a dependency. +
+Read before building your project! +

+ +You **must** use a shade / shadow plugin with your build system. KSpigot needs to be relocated. + +##### GRADLE + +The plugin: +```kotlin +id("com.github.johnrengelman.shadow") version "6.0.0" +``` + +Now KSpigot needs to be relocated by using one of the following methods: + +

+Relocate only KSpigot +

+ +Add the following to your buildscript: +```kotlin +tasks { + shadowJar { + relocate("net.axay.kspigot", "${project.group}.shadow.net.axay.kspigot") + } +} +``` + +

+
+ +
+Relocate all of your dependencies +

+ +Add the following to your buildscript: +```kotlin +val relocateShadowJar by tasks.creating(ConfigureShadowRelocation::class) { + target = tasks.shadowJar.get() + prefix = "${project.group}.shadow" +} + +tasks.shadowJar.get().dependsOn(relocateShadowJar) +``` + +

+
+ +##### MAVEN + +For example, you could use the [Apache Maven Shade Plugin](https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html). + +

+
+ ## About KSpigot is a kotlin extension for the popular [spigot server software](https://spigotmc.org/) for minecraft. -KSpigot adds functionality missing in spigot and partly makes it possible to do it the kotlin way. Most of KSpigot's extensions are stable. + +KSpigot adds functionality missing in spigot and makes it possible to do things the kotlin way.
Notice @@ -80,7 +136,7 @@ KSpigot adds functionality missing in spigot and partly makes it possible to do Extensions marked with the annotation `@NMS_GENERAL` are unstable. -Extensions marked with the `@UnsafeImplementaion` annotation do not promise to always give the correct result, but are still useful and therefore included in the project. This readme DOES NOT contain any unsafe parts of KSpigot. +Extensions marked with the `@UnsafeImplementaion` annotation do not promise to always give the correct result, but are still useful and therefore included in the project. This readme does not contain any unsafe parts of KSpigot. Please keep in mind that this extensions is still in a more early stage of development - some parts of the API may change in future versions.