Adding pineapple to your project
Welcome to PineappleLib, this wiki will explain how to add it and all of its features for you to add to your spigot plugins
Adding the repo
- Maven
- Gradle (Groovy)
- Gradle (Kotlin)
<repositories>
<repository>
<name>Miles Repository</name>
<url>https://maven.miles.sh/libraries</url>
</repository>
</repositories>
repositories {
maven {
name = "Miles Repository"
url = "https://maven.miles.sh/libraries"
}
}
repositories {
maven("https://maven.miles.sh/libraries")
}
Adding the dependency
- Maven
- Gradle (Groovy)
- Gradle (Kotlin)
<dependencies>
<dependency>
<groupId>sh.miles</groupId>
<artifactId>Pineapple</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
dependencies {
implementation("sh.miles:Pineapple:1.0.0-SNAPSHOT")
}
dependencies {
implementation("sh.miles:Pineapple:1.0.0-SNAPSHOT")
}
Shading PineappleLib
- Maven
- Gradle (Groovy)
- Gradle (Kotlin)
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>sh.miles.pineapple</pattern>
<shadedPattern>CHANGE.ME.libs.pineapple</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1"
}
shadowJar {
relocate('sh.miles.pineapple', 'CHANGE.ME.libs.pineapple')
}
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
}
shadowJar {
relocate('sh.miles.pineapple', 'CHANGE.ME.libs.pineapple')
}
Initializing
PineappleLib requires a plugin instance to function properly, to give it to Pineapple please add the following code to onEnable()
or onLoad()
PineappleLib.initialize(this)
While by default PineappleLib requires the use of NMS you can disable it before initialization
PineappleLib.initialize(this, false) // false disables NMS
danger
While disabling NMS is a supported feature not all NMS features have appropriate backups. Avoid NMS tags when disabling NMS