Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 2.77 KB

File metadata and controls

36 lines (28 loc) · 2.77 KB

Paper examples

Each directory below is self-contained at the application-source level: all custom classes referenced by that example are included in the same directory.

Level Example What it teaches
1 01-simple-feature annotated feature, generated catalog, ready-to-use host
2 02-owned-resources listener/task ownership and automatic cleanup
3 03-config-and-messages feature defaults and reload policy
4 04-dependencies-and-integrations feature dependencies, optional features, external plugins
5 05-capability-provider-consumer publishing and consuming a capability
6 06-multi-feature-plugin realistic multi-feature composition
7 07-advanced-lifecycle recreation, async work, manually owned resources
8 08-dataprovider DataProviderResources and a host resource contributor
9 09-dataregistry PaperDataRegistryAccess, DataRegistry, identity readiness
10 10-network-operations control-plane command, lifecycle operations, production feature graph
11 11-persistent-contract-board SQL-backed subsystem: transactions, two-level cache, async service, command, listener, config/messages, capability

Every example declares metadata beside the feature with @FeatureDeclaration; the bootstrap uses @GenerateFeatureCatalog and generated BuiltInFeatures.collection(). Start with 01 if the framework is new to you.

Paper host lifecycle operations follow Bukkit primary-thread semantics. Async tasks still require normal Bukkit thread-safety discipline; see Threading.

For developers evaluating this on a large network

Once you know the feature mental model, 11-persistent-contract-board shows a single cohesive feature as an application composition root, not a wrapper around one listener:

SQL source of truth → repository → async domain service → capability
                              ├── immutable hot snapshot + JSON fallback summary
                              ├── Brigadier command + localized responses
                              ├── join listener that never blocks on SQL
                              └── owned refresh/reconciliation task

Its README follows a claim race through MySQL and back to the Paper thread, documents cache authority and staleness, and explains what recreation replaces.