ServerFeatures is built as a modular system for Paper. Functionality is split into independent feature modules that can be enabled, disabled, and reloaded through configuration and commands.
- Keep feature implementations isolated to reduce cross-feature regression risk.
- Centralize lifecycle concerns (listeners, tasks, commands, caches, data access).
- Let operators roll out features incrementally instead of all at once.
At startup, the plugin:
- Initializes shared config and localization handlers.
- Discovers available feature classes through package scanning.
- Resolves metadata and dependency requirements.
- Prunes features with unresolved dependencies.
- Loads enabled features in dependency-safe order.
During runtime, each feature extends BukkitBaseFeature and uses FeatureLifecycleManager services for:
- listener registration
- scheduled tasks
- command registration
- optional data access (
DataProvider) - cache and GUI lifecycle
On disable/reload, feature cleanup cancels tasks, unregisters listeners/commands, closes data connections, and clears cache/GUI state to avoid leaks.
config.ymlis the primary control surface (features.*+ global keys).- Feature defaults are injected and unknown keys can be reconciled/cleaned per schema.
- Feature-local config files live in
local/*.yml. - Localization files live in
lang/*.yml.
For operators, this architecture means safer rollout and easier troubleshooting.
For contributors, it means clear ownership boundaries: keep feature logic inside the feature, and keep shared behavior in the framework.