diff --git a/.env.example b/.env.example index d37b335..2378a8d 100644 --- a/.env.example +++ b/.env.example @@ -16,6 +16,7 @@ MINECRAFT_BACKUP_PATH=./backups # Release version is read from Gradle's Git-sensitive semantic version and checked against the jar's plugin.yml. MODRINTH_TOKEN= MODRINTH_PROJECT_ID=metropolis-builder +# Optional Markdown override; empty generates notes from commits since the last tag. MODRINTH_CHANGELOG= MODRINTH_GAME_VERSIONS=26.2 MODRINTH_LOADERS=paper diff --git a/Modrinth-Description.md b/Modrinth-Description.md new file mode 100644 index 0000000..4754250 --- /dev/null +++ b/Modrinth-Description.md @@ -0,0 +1,45 @@ +**Metropolis** + +Metropolis grows a protected Minecraft city as players join. It assigns home plots connected by roads, expands the protected city region, and lets players and administrators manage homes and reserve plots. + +## Requirements + +- Paper 26.2 or 26.3. +- Java 25 or newer. +- WorldGuard 7.0.19 and WorldEdit 7.4.5. + +WorldGuard and WorldEdit are required dependencies. Install all three plugins in the server's `plugins` directory. + +Metropolis targets Paper only; Bukkit and Spigot servers are not supported. + +## Features + +- Automatically assigns a protected home plot when a player joins. +- Allows players to acquire additional homes up to their configured limit, with per-player overrides. +- Expands the protected city region as plots are occupied. +- Configures plot dimensions, roads, floors, supports, signs, spawn behavior, and perimeter walls. +- Reserves named plots by coordinates or a WorldEdit selection. +- Tracks home ownership and selected homes by player UUID. +- Supports home and plot teleportation, administration, and WorldGuard protection flags. + +## Configuration + +Metropolis creates `plugins/Metropolis/config.yml` on first startup. Configure plot limits and dimensions, roads, floors and supports, signs, spawn behavior, walls, world name, and per-player overrides. Use Bukkit material names; legacy numeric material IDs are also accepted for existing configurations. + +## Commands + +- `/metropolis` - Displays the plugin version. +- `/metropolis-home-acquire` - Acquires another available home plot. +- `/metropolis-home-generate ` - Generates a home for a known online or cached offline player. +- `/metropolis-home-list` - Lists occupied and reserved plots. +- `/metropolis-home-go [playerName]` - Teleports to a home. +- `/metropolis-home-move [playerName]` - Selects a player's home. +- `/metropolis-home-evict ` - Removes a player's ownership from their selected home region. +- `/metropolis-plot-reserve ` - Reserves a region by coordinates; players can use `/metropolis-plot-reserve ` with a WorldEdit selection. +- `/metropolis-plot-go [playerName]` - Teleports to a named plot. +- `/metropolis-flag-reset` - Reapplies Metropolis protection flags. +- `/metropolis-debug-generatetesthomes ` - Generates test homes; intended for development servers. + +## Build + +Run `./gradlew build` from the project directory. The plugin jar is created in `build/libs/`. diff --git a/Modrinth.json b/Modrinth.json new file mode 100644 index 0000000..7518370 --- /dev/null +++ b/Modrinth.json @@ -0,0 +1,13 @@ +{ + "name": "Metropolis", + "url": "https://modrinth.com/plugin/metropolis-builder", + "summary": "Grow a protected Minecraft city with automatic UUID-owned homes, configurable roads, WorldGuard protection, and reserved plots.", + "visibility": "public", + "links": { + "issueTracker": "https://github.com/headhunter45/Metropolis/issues", + "sourceCode": "https://github.com/headhunter45/Metropolis", + "wikiPage": null, + "discordInvite": null, + "donationLinks": [] + } +} diff --git a/Project-Description.json b/Project-Description.json index 1de18b6..2a2bdd8 100644 --- a/Project-Description.json +++ b/Project-Description.json @@ -1,7 +1,7 @@ { "id": "metropolis", "title": "Metropolis", - "description": "Paper plugin that automatically creates protected home plots and connecting roads as players join a Minecraft server.", + "description": "A Paper 26.2/26.3 city-planning plugin that turns player onboarding into procedural urban growth with protected UUID-owned homes, roads, reservations, and configurable infrastructure.", "docId": "Metropolis", "image": { "url": "Pixel-art aerial view of a growing Minecraft city planned in a square grid, small player home plots connected by pale roads, a protected central spawn, blocky green landscape, subtle WorldGuard-inspired boundary lines, warm daylight, clean game-plugin thumbnail composition, no words or logos.", diff --git a/Project-Description.md b/Project-Description.md index 9894c33..bd5294b 100644 --- a/Project-Description.md +++ b/Project-Description.md @@ -1,12 +1,5 @@ # Metropolis -Metropolis is a Paper plugin that expands a protected Minecraft city as players join. It generates home plots and connecting roads, uses WorldGuard to protect the city and homes, and supports reserved plots and home teleportation. +Metropolis turns player onboarding into city planning. As players arrive, the Paper plugin finds the next available plot, builds the surrounding roads and infrastructure, and extends a WorldGuard-protected city that feels designed rather than randomly generated. -## Platform - -- Paper 26.2, Java 25+ -- WorldGuard 7.0.19 and WorldEdit 7.4.5 -- Built with Gradle 9.8 and Git-sensitive semantic versioning -- Configuration: `plugins/Metropolis/config.yml` -- Unit tests run without a server; live integration tests use the separate Gradle `integrationTest` task. -- License: GNU General Public License v3 +The project combines procedural spatial logic, persistent UUID-based ownership, configurable construction rules, WorldEdit-assisted reservations, and a command suite for moving, acquiring, listing, and administering homes. It is also a modernization case study: a legacy plugin brought forward to Paper 26.2 and 26.3 with Gradle, focused unit tests, and opt-in live-server integration tests. Bukkit and Spigot servers are outside the support target. diff --git a/README.md b/README.md index dac8c0c..79bebf0 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,18 @@ Metropolis expands a protected Minecraft city as players join. Each player can receive a home plot connected by generated roads; WorldGuard protects the city, homes, and reserved plots. +## Features + +- Assigns a protected home plot when a player joins and supports acquiring additional homes up to the configured player limit. +- Expands the City region as plots are occupied, with optional spawn generation, world-spawn placement, floors, support blocks, signs, and perimeter walls. +- Generates roads around plots with configurable width, level, material, clearance, and supports. +- Creates named protected reservations from coordinates or a WorldEdit selection so reserved plots are not assigned as homes. +- Persists selected homes by player UUID and recognizes legacy name-based home data during migration. +- Supports online/offline player administration for home generation, movement, and eviction. + ## Requirements -- Paper 26.2, with Java 25 or newer +- Paper 26.2 or 26.3, with Java 25 or newer - WorldGuard 7.0.19 - WorldEdit 7.4.5 @@ -41,26 +50,28 @@ Copy `.env.example` to `.env` and configure the Paper version/build and server p - `tools/start-server.sh` downloads the configured Paper build if needed and starts it. - `tools/backup-server.sh` and `tools/restore-server.sh` back up or restore the configured server. - `tools/publish-local.sh` publishes the artifact to the local Maven repository. -- `tools/publish-modrinth.sh` uploads a built jar after checking its version. +- `tools/publish-modrinth.sh` uploads a built jar after checking its version and generates a Markdown changelog from Git commits since the previous version tag. Set `MODRINTH_CHANGELOG` to override it with curated notes. + ## Configuration -The default configuration is in `src/main/resources/config.yml` and is copied to `plugins/Metropolis/config.yml` on first startup. Materials use Bukkit names; the previous numeric IDs for stone, grass, cobblestone, and bedrock are still accepted when loading a configuration. - -Player home ownership and selected-home data use UUIDs. Existing name-keyed `currentHomes.yml` entries and name-based WorldGuard home regions are recognized during migration. +`plugins/Metropolis/config.yml` controls plot dimensions and limits, floor and support generation, signs, road width/level/material/clearance, spawn behavior, wall generation, world name, and per-player overrides. The bundled configuration provides the defaults. Metropolis targets Paper 26.2 and 26.3 only; Bukkit and Spigot servers are not supported. ## Commands -- `/metropolis` displays the plugin version. -- `/metropolis-home-acquire` acquires an available home plot. -- `/metropolis-home-generate ` generates a home for a known online or cached offline player. -- `/metropolis-home-list` lists Metropolis plots. -- `/metropolis-home-go [player]` teleports to a home. -- `/metropolis-home-move [player]` changes a player's selected home. -- `/metropolis-home-evict ` removes a player's home ownership. -- `/metropolis-plot-reserve ` reserves coordinates; a player may instead provide a WorldEdit selection. -- `/metropolis-plot-go [player]` teleports to a plot. -- `/metropolis-flag-reset` reapplies Metropolis protection flags. +| Command | Permission | Description | +| --- | --- | --- | +| `/metropolis` | None | Displays the plugin version. | +| `/metropolis-home-acquire` | Player only | Acquires an available home if the player's home limit is not reached. | +| `/metropolis-home-generate ` | `metropolis.home.generate` | Generates a home for an online or cached offline player. | +| `/metropolis-home-list` | `metropolis.home.list` | Lists the occupied and reserved Metropolis plots with their bounds. | +| `/metropolis-home-go [playerName]` | `metropolis.home.go` | Teleports the sender, or a permitted target player, to their home. | +| `/metropolis-home-move [playerName]` | `metropolis.home.move` | Selects one of a player's existing home regions. The player argument defaults to the sender. | +| `/metropolis-home-evict ` | `metropolis.home.evict` | Removes the player's ownership from their selected home region. | +| `/metropolis-plot-reserve ` | `metropolis.plot.reserve` | Creates a named reservation from explicit bounds. A player can instead run `/metropolis-plot-reserve ` with a WorldEdit selection. | +| `/metropolis-plot-go [playerName]` | `metropolis.plot.go` | Teleports the sender or target player to a named occupied or reserved plot. | +| `/metropolis-flag-reset` | `metropolis.flag.reset` | Reapplies Metropolis protection flags to the City and home regions. | +| `/metropolis-debug-generatetesthomes ` | `metropolis.debug` | Generates test homes; intended for development servers. | ## License diff --git a/build.gradle b/build.gradle index 1e1bafe..8344484 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ description = 'Metropolis' gitSemVer { minimumVersion.set('0.5.0') - versionPrefix.set('') + versionPrefix.set('v') } repositories { diff --git a/tools/publish-modrinth.sh b/tools/publish-modrinth.sh index c01860e..9cb8cad 100755 --- a/tools/publish-modrinth.sh +++ b/tools/publish-modrinth.sh @@ -44,8 +44,24 @@ MODRINTH_VERSION="${MODRINTH_VERSION:-${VERSION:-}}" if [[ -z "$MODRINTH_VERSION" ]]; then MODRINTH_VERSION=$(cd "$PROJECT_ROOT" && ./gradlew -q properties --property version | sed -n 's/^version: //p' | head -n1) fi -MODRINTH_CHANGELOG="${MODRINTH_CHANGELOG:-Auto release via publish-modrinth.sh}" -MODRINTH_GAME_VERSIONS="${MODRINTH_GAME_VERSIONS:-26.2}" +generate_changelog() { + local current_tag previous_tag range commits + current_tag=$(git -C "$PROJECT_ROOT" describe --tags --exact-match HEAD 2>/dev/null || true) + if [[ -n "$current_tag" ]]; then + previous_tag=$(git -C "$PROJECT_ROOT" describe --tags --abbrev=0 "${current_tag}^" 2>/dev/null || true) + range="${previous_tag:+$previous_tag..}$current_tag" + else + previous_tag=$(git -C "$PROJECT_ROOT" describe --tags --abbrev=0 2>/dev/null || true) + range="${previous_tag:+$previous_tag..}HEAD" + fi + commits=$(git -C "$PROJECT_ROOT" log --no-merges --format='- %s (%h)' "$range" 2>/dev/null || true) + if [[ -z "$commits" ]]; then + commits='- No commit messages found for this release.' + fi + printf '%s\n\n%s\n' "## What's Changed" "$commits" +} +MODRINTH_CHANGELOG="${MODRINTH_CHANGELOG:-$(generate_changelog)}" +MODRINTH_GAME_VERSIONS="${MODRINTH_GAME_VERSIONS:-26.2,26.3}" MODRINTH_LOADERS="${MODRINTH_LOADERS:-paper}" MODRINTH_VERSION_TYPE="${MODRINTH_VERSION_TYPE:-}" MODRINTH_FILE="${MODRINTH_FILE:-}"