CraftPlugin is a Minecraft library to make the development of Spigot/Paper easier and quicker. It supports Spigot and Paper. The library is designed so that you don't have to make the difference between Spigot or Paper while developing.
The library is developed for minimum Minecraft 1.19
and supports latests versions.
<dependencies>
<dependency>
<groupId>be.machigan</groupId>
<artifactId>craftplugin</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
Warning
Do not forget the Apache Shade Plugin to include the library in your final jar.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>be.machigan:craftplugin</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
repositories {
mavenCentral()
}
dependencies {
implementation "be.machigan:craftplugin:VERSION"
}
Warning
Do not forget the include the library in the final jar.
tasks.jar {
from configurations.runtimeClasspath.collect {
it.isDirectory() && it.name == 'craftplugin-VERSION' ? it : zipTree(it)
}
}
Once you've included the library in your project, just register your plugin to the library.
public class CraftPluginExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
CraftPlugin.registerPlugin(this);
}
}