-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
STEMCraft starts in STEMCraft.java and builds the runtime in four passes:
- Verifies Paper and the minimum supported Minecraft version (26.2)
- Bootstraps config and task infrastructure
- Instantiates core services and exposes them through
STEMCraftAPI - Scans and loads built-in features from
dev.stemcraft.feature - Scans and loads built-in commands and minigames
The plugin relies heavily on runtime registration rather than a static registry file.
-
api/src/main/java/dev/stemcraft/apiPublic interfaces, command abstractions, service contracts, minigame contracts, and shared models -
plugin/src/main/java/dev/stemcraft/serviceRuntime implementations of API services -
plugin/src/main/java/dev/stemcraft/featureOptional gameplay features that can register listeners, commands, and config-backed behavior -
plugin/src/main/java/dev/stemcraft/commandStandalone commands loaded throughBaseCommand -
plugin/src/main/java/dev/stemcraft/minigameBuilt-in minigames and their command/config/runtime logic -
plugin/src/main/resourcesplugin.yml, locales, bundled defaults, and other plugin resources -
docsOperator and developer documentation
Services are instantiated directly in STEMCraft.java and attached to STEMCraftAPIImpl.
Important consequence:
- service availability is explicit
- the API surface is stable even when individual features are disabled
- services own durable resources such as database access, web endpoints, tab completion registries, and world management
Features are discovered by scanning dev/stemcraft/feature for subclasses of BaseFeature.
Important consequence:
- adding a new feature usually means adding one class in that package
- enablement is config-driven through
BaseFeature - features can register commands, event listeners, scheduled tasks, and DB-backed state
Commands come from more than one place:
-
dev.stemcraft.commandviaBaseCommand - service-owned command classes such as
WorldCommand,ResourcePackCommand, andHubCommand - feature-owned direct registrations such as
/book,/coord,/speed, and/imenu - minigame command classes such as
/bridgeand/nightfall
Minigames are discovered by scanning dev/stemcraft/minigame for subclasses of BaseMiniGame.
Each minigame typically owns:
- one command class
- one config helper
- one arena handler
- one arena record type
- the gameplay runtime implementation
STEMCraft uses two main persistence models:
- YAML config files for static configuration and operator-managed content
- SQLite for durable runtime state
Typical DB-backed systems include:
- punishments
- reports and moderation incidents
- first-join verification state
- player stats
- persistent scheduled tasks
- random first spawn state
- custom book state
- world change recording
User-facing text is expected to go through the locale and message services rather than being hardcoded inline.
Main pieces:
-
LocaleServiceresolves keys and locale files -
MessageServiceformats and dispatches messages -
TokenProcessorapplies placeholder-like token expansion
When adding new behavior:
- put shared, reusable mechanics behind a service or API interface
- put optional gameplay behavior behind a feature
- keep command handling near the domain it controls
- prefer DB for runtime state and YAML for operator-authored configuration
- Home
- Architecture
- Services
- Features
- Build a Custom Tool
- Agriculture and Cooking
- Survival quality of life
- Custom items
- Slime and Magma Buckets
- Comets
- Rotten Flesh Uses
- Iron Golem Poppy Luring
- Gifts
- Mailboxes
- Notice boards
- Named regions
- Interactive guide callbacks
- Quests
- Commands
- API
- Minigames
- Minigame placeholders
- Tab completion
- Configuration
- Entitlements and badges
- Player reset service