Database & Progress System
Supported Database Types
SQLite (Default)
- File-based:
plugins/PremiumAdvancements/data.db - No external setup required
- Best for small to medium servers (< 50 players)
- Uses the SQLite JDBC driver
MySQL / MariaDB
- External database server required
- Uses HikariCP connection pooling
- Best for large servers or server networks (BungeeCord/Velocity)
Connection Pool Settings
Database Tables
player_advancements
player_progress
Player Progress System
Architecture
The progress system uses a two-layer architecture:
- In-memory cache (ConcurrentHashMap): Fast read/write operations during gameplay
- Database (SQLite/MySQL): Persistent storage for server restarts
Auto-Save
- Every 30 seconds, all cached progress is saved to the database asynchronously
- On player quit: Progress is saved immediately
- On server shutdown: All progress is force-saved synchronously
Progress Flow
- Player triggers an advancement event
- Trigger service checks permissions, worlds, prerequisites, and existing completion
- If advancement requires progress (amount > 1), increment is stored in cache
- Cache is periodically synced to the database
- When progress reaches the required amount, advancement is completed
- All rewards are processed synchronously (commands, items, money, etc.)
- Discord webhook is sent asynchronously
Real-time Updates
When an advancement is completed, the plugin re-checks all dependent/hidden advancements in real-time. If prerequisites are now met, hidden advancements are immediately revealed.