Examples
Task-focused guides for the main features of cw-commons. Each page is a self-contained walkthrough with copy-pasteable code.
Configuration & commands
- Config Loading — load and validate a YAML config with
ConfigManager. - Bukkit Types — bind
LocationandItemStackfields in configs and stored values, and their serialized format. - Commands — register commands with
BaseCommand.
Data storage
Start with Data Store; the other two build on it but not on each other, so read whichever applies to you (and skip MongoDB entirely if you don’t need it):
- Data Store — the concepts behind the write-behind key-value store, plus the bundled SQLite backend. Start here.
- Bukkit Integration — per-player data, periodic flushing, and storing Bukkit types like
LocationandItemStack. - MongoDB Backend — optional. The same
DataStoreAPI, backed by MongoDB instead of a local file.
For the full API, see the Javadoc.