Features
- Easy setup
- Full Picocli @ Command support (thanks to picocli-spring-boot-starter)
- Secure calls with @Authorize
- Automatic Listener registration
- Full Spring's dependency injection support
- Easier Bukkit main thread synchronization via @Synchronize
Getting started
Add the Spring boot starter to your project
<dependency>
<groupId>dev.alangomes</groupId>
<artifactId>spring-boot-starter-spigot</artifactId>
<version>0.9.0</version>
</dependency>
Create a class to configure the Spring boot application
@SpringBootApplication(scanBasePackages = "me.test.testplugin")
public class Application {
}
Then create the plugin main class using the standard spring initialization, just adding the SpringSpigotInitializer initializer.
public class ExamplePlugin extends JavaPlugin {
private ConfigurableApplicationContext context;
@Override
@SneakyThrows
public void onEnable() {
saveDefaultConfig();
ResourceLoader loader = new DefaultResourceLoader(getClassLoader());
SpringApplication application = new SpringApplication(loader, Application.class);
application.addInitializers(new SpringSpigotInitializer(this));
context = application.run();
}
@Override
public void onDisable() {
context.close();
context = null;
}
}
And that's it! Your plugin is ready to use all features from Picocli and Spring Boot!
Read more at the project documentation
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta