This repo contains:
- A multi-module Gradle project for a server-only Fabric mod that assists region migration via bossbars and
/regioncommands. - An offline migration script (
region_migrator/migrate_region.sh) to copy one region and related data from a legacy world to the main world, with backups and an offline upgrade.
- Java (for building/running and the offline upgrade step)
- Bash and coreutils
jq(only needed when using--auto-region)
Use the Gradle wrapper at the repo root. This builds all modules.
./gradlew buildArtifacts are in each module’s build/libs.
Script: region_migrator/migrate_region.sh
What it does:
- Creates a lock and logs to
region_migrator/logs/. - Backs up destination files under
region_migrator/backups/<dim>/<rx_rz>-<timestamp>/. - Copies the legacy world to
region_migrator/upgrade-tmp/and accepts EULA. - Finds your main server jar and runs an offline
--forceUpgrade --eraseCache --world <upgrade-tmp/world>. - Copies the upgraded region, entities, POI, and structures to the main world using the same region name (no renaming/shifting).
Usage (help):
bash region_migrator/migrate_region.sh --helpExample (explicit region, overworld):
bash region_migrator/migrate_region.sh \
--legacy-world /srv/legacy/world \
--main-world /srv/main/world \
--dim overworld \
--region 1 1 \
--backup-keep 10 \
--ram 2GAuto-region example (reads state from mod config on both servers):
bash region_migrator/migrate_region.sh \
--legacy-world /srv/legacy/world \
--main-world /srv/main/world \
--dim nether \
--auto-regionNotes:
- Ensure both servers are stopped before running; the script will warn if ports 25565/25566 are busy.
- The script copies files with the same region coordinates (no Python shift step).
--auto-regionnow reads MAIN'smain_region.jsononly and uses those coordinates (and dim if not set via CLI).
build.gradle.kts,settings.gradle.kts: Gradle setup (Loom + multi-module).src/(root sample): placeholder.region_migrator/: offline migration tools.migrate_region.sh: main script (see above).logs/,backups/,upgrade-tmp/: generated at runtime; ignored by git.
- Missing
jq: install it when using--auto-region. - No server jar found: set
--main-server-diror place a server jar (e.g.,server.jar) next to your main world. - Permissions: run with a user that can read/write the world folders.
MIT (or your preferred license—update this section if different).
Server-side only bossbar guidance for region migration with MAIN/LEGACY roles. See COPILOT_PLAYBOOK.prompt.md for spec.
- mc1_21_x requires JDK 21
- mc1_20_1 requires JDK 17
- mc1_14_4 requires JDK 8
- Edit
config/region-migrator/config.jsonafter first run. SetroletoMAINorLEGACY. - Commands (requires OP≥2 except
/hint):/region mark <dim> <rX> <rZ>/region auto/region confirm [time]/region cancel/region clear/region show/hint on|off(anyone)
Bossbars show only while a target region is applied and players are in relevant areas.
./gradlew :mc1_21_x:runServer ./gradlew :mc1_20_1:runServer
./gradlew :mc1_21_x:build ./gradlew dist
Note: mc1_14_4 is temporarily excluded while focusing on higher versions.