Quartz is still a work in progress
Quartz is a dependency-injection framework made mainly for Minecraft Plugins inspired by Spring Boot, but also supports generic JVM-applications
- Easy configuration file (TOML, YAML) management with @Config
- Automatic service registration with @Service or @Component
- Async scheduler utilizing Kotlin channels for database operations with
FixedScheduler
- git clone https://github.com/0xc0ffee1/quartz/
- cd quartz && ./gradlew publish
- Add the wanted modules as your dependencies
dependencies {
...
implementation "net.c0ffee1.quartz:quartz-core:1.0-SNAPSHOT"
implementation "net.c0ffee1.quartz:quartz-bukkit:1.0-SNAPSHOT"
implementation "net.c0ffee1.quartz:quartz-db-core:1.0-SNAPSHOT"
...
}
- Implement
QuartzBukkitPlugin
in yourJavaPlugin
- in
onEnable
callQuartz.init(new BukkitPlatform(YourPlugin.class, this));
- You're now ready to use quartz
Simple Bukkit event listener:
@Service
@RegisterEvents
public class ExampleEventListener implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent event){
event.getPlayer().sendMessage("Hello world!");
}
}
@Config(file = "config", node = "example", type = "toml")
@Getter
public class ExampleConfig {
@JsonProperty("example_map")
private HashMap<String, Integer> exampleMap;
}
That will load the map from a toml config defined like this:
[example.example_map]
some_key="hello"
other_key="world"
Quartz uses Guice under the hood. Refer to its documentation here: https://github.com/google/guice/wiki/GettingStarted