Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Region Migrator (Fabric server-only mod + offline tools)

This repo contains:

  • A multi-module Gradle project for a server-only Fabric mod that assists region migration via bossbars and /region commands.
  • 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.

Requirements

  • Java (for building/running and the offline upgrade step)
  • Bash and coreutils
  • jq (only needed when using --auto-region)

Build the mod

Use the Gradle wrapper at the repo root. This builds all modules.

./gradlew build

Artifacts are in each module’s build/libs.

Offline migration script

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 --help

Example (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 2G

Auto-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-region

Notes:

  • 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-region now reads MAIN's main_region.json only and uses those coordinates (and dim if not set via CLI).

Project layout

  • 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.

Troubleshooting

  • Missing jq: install it when using --auto-region.
  • No server jar found: set --main-server-dir or 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.

License

MIT (or your preferred license—update this section if different).

Region Migrator (Fabric)

Server-side only bossbar guidance for region migration with MAIN/LEGACY roles. See COPILOT_PLAYBOOK.prompt.md for spec.

Build

  • mc1_21_x requires JDK 21
  • mc1_20_1 requires JDK 17
  • mc1_14_4 requires JDK 8

Usage

  • Edit config/region-migrator/config.json after first run. Set role to MAIN or LEGACY.
  • 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.

Run dev server

./gradlew :mc1_21_x:runServer ./gradlew :mc1_20_1:runServer

Build one or all

./gradlew :mc1_21_x:build ./gradlew dist

Note: mc1_14_4 is temporarily excluded while focusing on higher versions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages