Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
A fork of GriefPrevention that adds 3D subdivisions
GriefPrevention3D v19.1.1
Wiki: https://github.com/castledking/GriefPrevention3D/wiki
Back up GriefPreventionData before updating.
Folia-Supported MySQL & MariaDB Storage
Database storage on Bukkit, Paper, Purpur, and Folia has been rebuilt for regionized multithreading and modern MySQL/MariaDB servers without inflating the universal JAR:
- Thread-safe JDBC connection pool: Replaces the legacy single shared
Connectionwith a bounded, zero-dependency connection pool (poolSizedefault8, automatically1for SQLite). Idle connections are validated againstmaxLifetimeMs/idleTimeoutMs, dead connections dropped by MySQLwait_timeoutare transparently replaced with automatic single-retry recovery, and every write executes inside an atomic JDBC transaction (commit/rollback) so a mid-save disconnect can no longer lose claims or player data. - Non-blocking async write pipeline: Claim saves, batched
saveClaimswrites, claim deletions, player claim-block updates, group bonus blocks, andnextClaimIDupdates capture immutable snapshots on the calling thread and execute asynchronously on an ordered background writer thread. Folia region threads and global tick threads no longer stall on MySQL round-trips, rapid edits to the same claim/player coalesce into a single write, pending writes are cancelled on delete, and all queued changes drain cleanly on server shutdown. - Async player pre-login preload: Player claim blocks and preferences are preloaded from the
database during
AsyncPlayerPreLoginEventbefore the player enters a Folia region, while rapid relogs read directly from any unflushed pending write to prevent stale data. - Real MySQL 5.7/8.0/8.4 & MariaDB compatibility: Replaced MariaDB-only
ALTER TABLE ... ADD COLUMN IF NOT EXISTSand MySQL-illegalTEXT DEFAULT ''migrations with catalog-scoped JDBC metadata checks so schema upgrades work cleanly across MySQL, MariaDB, and SQLite (even on multi-database MySQL servers). - Flat-file parity & safer migration: Added database persistence for manual
neighbors,allowallneighbors, and per-playerglowenabled(/gpglow), restoredparentId-first subdivision attachment for nested and 3D subdivisions, and updated flat-file-to-database migration to migrate nested subdivisions recursively and flush all committed data before backing upClaimDataandPlayerData. - External driver fallback: Uses server-bundled MySQL/SQLite JDBC drivers automatically and
also scans
plugins/GriefPreventionData/drivers/*.jarif a custom or standalone driver is needed. - Clean shutdown on database startup failure: Guarded
onDisable()against a nulldataStoreso an invalid database configuration disables the plugin cleanly without throwing aNullPointerException.
Configuration
Create plugins/GriefPreventionData/database.properties to enable database storage:
jdbcUrl=jdbc:mysql://127.0.0.1:3306/griefprevention
username=your_user
password=your_password
poolSize=8
connectionTimeoutMs=10000
idleTimeoutMs=300000
maxLifetimeMs=1800000
validationTimeoutSeconds=3
- Existing credentials configured under
GriefPrevention.Database.*inplugins/GriefPreventionData/config.ymlare automatically migrated intoplugins/GriefPreventionData/database.propertieson startup so passwords stay out ofconfig.yml. - Backwards-compatible fallback to
database.*inplugins/GriefPrevention3D/config.ymlis also preserved.
Upgrade notes
- Restart the server after replacing the jar.
- Both platforms continue to ship in one universal
GriefPrevention3D.jar: Spigot/Paper/Purpur/Folia (1.8 through modern) and Fabric (1.21.2 through 1.21.11, and 26.1 through 26.3). Fabric requires Fabric API. - Existing MySQL/MariaDB/SQLite databases gain missing columns (
neighbors,allowallneighbors,glowenabled, etc.) automatically on first startup.
Platforms
Paper
1.8.8–26.3