Chunk-level lock plugin for CreaClone — preserves creative builds during world sync
  • Java 95.7%
  • Shell 4.3%
Find a file
exo 31cc3e65ff
All checks were successful
Build & Release / build (push) Successful in 1m12s
Build & Release / release (push) Successful in 2s
v3.2.0: create missing region files on restore
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.
2026-05-11 01:45:45 +02:00
.forgejo/workflows Initial commit: ChunkLock plugin v1.0.0 2026-05-10 01:33:50 +02:00
gradle/wrapper Initial commit: ChunkLock plugin v1.0.0 2026-05-10 01:33:50 +02:00
src/main v3.2.0: create missing region files on restore 2026-05-11 01:45:45 +02:00
.gitignore Add .gitignore, remove build artifacts 2026-05-10 01:33:58 +02:00
build.gradle.kts v3.2.0: create missing region files on restore 2026-05-11 01:45:45 +02:00
gradlew Initial commit: ChunkLock plugin v1.0.0 2026-05-10 01:33:50 +02:00
gradlew.bat Initial commit: ChunkLock plugin v1.0.0 2026-05-10 01:33:50 +02:00
README.md Add documentation 2026-05-10 10:12:35 +02:00
settings.gradle.kts Initial commit: ChunkLock plugin v1.0.0 2026-05-10 01:33:50 +02:00
sync-creaclone.sh Add world navigation: /lobby, /flat, /survival, /worlds 2026-05-10 09:47:23 +02:00

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 /survival transfer 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:

  1. Stops the MC server
  2. Calls CLI backup with the lock file
  3. Runs rsync from production world
  4. Calls CLI restore to re-inject locked chunks
  5. Restarts the MC server

License

MIT