Chunk-level lock plugin for CreaClone — preserves creative builds during world sync
- Java 95.7%
- Shell 4.3%
If rsync --delete removes a region file that contains locked chunks, the restore now creates an empty 8KB region file (Anvil header) and injects the snapshot data into it. |
||
|---|---|---|
| .forgejo/workflows | ||
| gradle/wrapper | ||
| src/main | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
| sync-creaclone.sh | ||
ChunkLock
Chunk-level lock plugin for Minecraft creative clone servers. Preserves player builds during automated world syncs from a production survival server.
How it works
CreaClone receives a daily rsync of the production world. ChunkLock lets players lock chunks so their creative modifications survive the sync. Locked chunks are backed up before rsync and restored after, using chunk-level Anvil (.mca) I/O via Querz/NBT.
┌─────────────────────────────────────────────┐
│ Daily sync (cron 4h) │
│ │
│ 1. Stop CreaClone server │
│ 2. Backup locked chunks (region/entities/poi) │
│ 3. rsync production → CreaClone world │
│ 4. Restore locked chunks into synced world │
│ 5. Start CreaClone server │
└─────────────────────────────────────────────┘
Commands
Player commands (permission: chunklock.use)
| Command | Description |
|---|---|
/chunklock |
Lock the chunk you're standing in |
/chunkunlock |
Unlock the chunk (will be overwritten on next sync) |
/chunklist [page] |
List all locked chunks |
/worlds |
Clickable world selection menu |
/lobby |
Teleport to creative clone world |
/flat |
Teleport to superflat world (auto-created) |
/survival |
Transfer back to survival server (via Velocity) |
Admin commands (permission: chunklock.admin)
| Command | Description |
|---|---|
/chunkadmin list |
List locked chunks grouped by region |
/chunkadmin clear |
Clear all chunk locks |
/chunkadmin export |
Export locked regions list for sync script |
CLI (for sync scripts)
The plugin JAR includes a CLI for pre/post-rsync operations:
# Backup locked chunks before rsync
java -cp ChunkLock-1.1.0.jar fr.ekaii.chunklock.RegionMergerCLI backup \
/path/to/world /path/to/locked-chunks.csv /path/to/backup
# Restore locked chunks after rsync
java -cp ChunkLock-1.1.0.jar fr.ekaii.chunklock.RegionMergerCLI restore \
/path/to/world /path/to/locked-chunks.csv /path/to/backup
The CLI handles region/, entities/, and poi/ subdirectories automatically.
Data files
| File | Location | Purpose |
|---|---|---|
locked-chunks.csv |
plugins/ChunkLock/ |
Machine-readable lock list (world,chunkX,chunkZ) |
| Lock file is the contract between the plugin and the rsync script. |
Requirements
- Paper/Luminol/Folia 1.21+ (marked
folia-supported: true) - Java 21+
- Velocity proxy (for
/survivaltransfer via BungeeCord channel)
Build
./gradlew shadowJar
# Output: build/libs/ChunkLock-<version>.jar
Sync script
See sync-creaclone.sh — the rsync wrapper that integrates with ChunkLock:
- Stops the MC server
- Calls CLI
backupwith the lock file - Runs rsync from production world
- Calls CLI
restoreto re-inject locked chunks - Restarts the MC server
License
MIT