Project structure
A Maven multi-module project, Java 25.
| Folder | Artifact | What it is |
|---|---|---|
common/ | library | What the proxy and the game servers share: the module system, player data, database access, the gRPC client of server-service, presence in Redis, permissions. Most of the stable API lives here. |
paper/ | library | The Paper side: commands, services, events, placeholders, the region hooks. |
modules/ | libraries | The modules shipped with GrayCore, one sub-module each (kits, warps). See Writing a module. |
paper-dist/ | graycore-paper.jar | Packs paper and the modules into the plugin installed on game servers. Also holds the test that keeps modules inside the stable API. |
velocity/ | graycore-velocity.jar | The proxy plugin. |
server-service/ | Spring Boot application | The registry of game servers, built as a Docker image by the CI. |
samples/rpg-sample/ | graycore-rpg-sample.jar | A plugin that adds a module from outside, as any plugin on top of GrayCore would: custom mobs with 3D models. |
dev/ | The local development stack. | |
docs/ | This site. |
Building and testing
mvn verify # everything: build, unit tests, integration tests
mvn -pl samples/rpg-sample -am package # one artifact and what it depends on
- Unit tests (Surefire) run with
mvn test. - Integration tests (Failsafe, classes ending in
IT) start PostgreSQL and Redis with Testcontainers: Docker must be running. - The CI (
.github/workflows/build.yml) runsmvn verifyon every push and pull request, then publishes the artifacts..github/workflows/docs.ymlbuilds this site and publishes it.
Technical choices
- Dependency injection on the game servers and the proxy is done by LightWired (
@LightWiredclasses are created and wired at startup). - Commands use CommandAPI, relocated inside the jars. A plugin on top of GrayCore cannot use that copy: it is not part of the stable API (the RPG sample registers its command through Bukkit's command map).
- Database: HikariCP and plain JDBC, the schema in Liquibase. Profiles are JSON (
jsonb), written with Jackson. - Redis: Lettuce.
- server-service: Spring Boot and Spring gRPC.
- Texts: MiniMessage, through
LocaleService.