Architecture Overview¶
CuriosPaper follows a modular architecture with clear separation of concerns across its packages.
Package Structure¶
org.bg52.curiospaper
├── api/ → Public API interface + implementation
├── command/ → Command executors (/curios, /baubles, /edit)
├── config/ → Configuration loading and validation
├── data/ → Data models (ItemData, AbilityData, RecipeData, etc.)
├── event/ → Custom Bukkit events
├── handler/ → Feature handlers (ElytraBackSlotHandler)
├── inventory/ → GUI implementations (AccessoryGUI, EditGUI)
├── listener/ → Bukkit event listeners
├── manager/ → Core managers (SlotManager, ItemDataManager)
├── resourcepack/ → Resource pack generation and hosting
└── util/ → Version utilities and helpers
Component Diagram¶
┌─────────────────────────────────────────────────────────┐
│ CuriosPaper.java │
│ (Main Plugin Class) │
└────────────────────────┬────────────────────────────────┘
│ initializes
┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌───────────────────┐
│ConfigManager│ │ SlotManager │ │ ItemDataManager │
│(config.yml) │ │(player data)│ │ (custom items) │
└──────────────┘ └──────────────┘ └───────────────────┘
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌───────────────────┐
│AccessoryGUI │ │ Listeners │ │ResourcePackMgr │
│EditGUI │ │(events,inv) │ │(HTTP + pack gen)│
└──────────────┘ └──────────────┘ └───────────────────┘
│ │
▼ ▼
┌───────────────────────────────────────────────────────┐
│ CuriosPaperAPI (public API) │
│ CuriosPaperAPIImpl │
└───────────────────────────────────────────────────────┘
Initialization Order¶
ConfigManager— Loadsconfig.ymland slot configurationsSlotManager— Initializes player data storageItemDataManager— Loads custom items fromitems/(if item editor enabled)ChatInputManager— Registers for chat input capture (if item editor enabled)ResourcePackManager— Generates and hosts the resource packCuriosPaperAPIImpl— Creates the API implementation- GUIs —
AccessoryGUIandEditGUIinstances - Listeners —
InventoryListener,AbilityListener,RecipeListener, etc. ElytraBackSlotHandler— Registers if feature enabled and version supported- Commands —
/curios,/baubles,/editcommand executors - Auto-save task — Periodic player data saves
- bStats — Anonymous usage metrics
Shutdown Order¶
- Cancel auto-save task
- Unregister crafting recipes
- Clean up external items
- Shut down resource pack HTTP server
- Shut down ability listener
- Save all player data