Fixes some @NonNull warnings.
This commit is contained in:
@@ -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.
|
# Release version is read from Gradle's Git-sensitive semantic version and checked against the jar's plugin.yml.
|
||||||
MODRINTH_TOKEN=
|
MODRINTH_TOKEN=
|
||||||
MODRINTH_PROJECT_ID=metropolis-builder
|
MODRINTH_PROJECT_ID=metropolis-builder
|
||||||
|
# Optional Markdown override; empty generates notes from commits since the last tag.
|
||||||
MODRINTH_CHANGELOG=
|
MODRINTH_CHANGELOG=
|
||||||
MODRINTH_GAME_VERSIONS=26.2
|
MODRINTH_GAME_VERSIONS=26.2
|
||||||
MODRINTH_LOADERS=paper
|
MODRINTH_LOADERS=paper
|
||||||
|
|||||||
45
Modrinth-Description.md
Normal file
45
Modrinth-Description.md
Normal file
@@ -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 <playerName>` - 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 <homeNumber> [playerName]` - Selects a player's home.
|
||||||
|
- `/metropolis-home-evict <playerName>` - Removes a player's ownership from their selected home region.
|
||||||
|
- `/metropolis-plot-reserve <name> <minX> <minY> <minZ> <maxX> <maxY> <maxZ>` - Reserves a region by coordinates; players can use `/metropolis-plot-reserve <name>` with a WorldEdit selection.
|
||||||
|
- `/metropolis-plot-go <plotName> [playerName]` - Teleports to a named plot.
|
||||||
|
- `/metropolis-flag-reset` - Reapplies Metropolis protection flags.
|
||||||
|
- `/metropolis-debug-generatetesthomes <count>` - Generates test homes; intended for development servers.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Run `./gradlew build` from the project directory. The plugin jar is created in `build/libs/`.
|
||||||
13
Modrinth.json
Normal file
13
Modrinth.json
Normal file
@@ -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": []
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "metropolis",
|
"id": "metropolis",
|
||||||
"title": "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",
|
"docId": "Metropolis",
|
||||||
"image": {
|
"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.",
|
"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.",
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
# Metropolis
|
# 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
|
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.
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|||||||
41
README.md
41
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.
|
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
|
## Requirements
|
||||||
|
|
||||||
- Paper 26.2, with Java 25 or newer
|
- Paper 26.2 or 26.3, with Java 25 or newer
|
||||||
- WorldGuard 7.0.19
|
- WorldGuard 7.0.19
|
||||||
- WorldEdit 7.4.5
|
- 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/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/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-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
|
## 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.
|
`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.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
- `/metropolis` displays the plugin version.
|
| Command | Permission | Description |
|
||||||
- `/metropolis-home-acquire` acquires an available home plot.
|
| --- | --- | --- |
|
||||||
- `/metropolis-home-generate <player>` generates a home for a known online or cached offline player.
|
| `/metropolis` | None | Displays the plugin version. |
|
||||||
- `/metropolis-home-list` lists Metropolis plots.
|
| `/metropolis-home-acquire` | Player only | Acquires an available home if the player's home limit is not reached. |
|
||||||
- `/metropolis-home-go [player]` teleports to a home.
|
| `/metropolis-home-generate <playerName>` | `metropolis.home.generate` | Generates a home for an online or cached offline player. |
|
||||||
- `/metropolis-home-move <home-number> [player]` changes a player's selected home.
|
| `/metropolis-home-list` | `metropolis.home.list` | Lists the occupied and reserved Metropolis plots with their bounds. |
|
||||||
- `/metropolis-home-evict <player>` removes a player's home ownership.
|
| `/metropolis-home-go [playerName]` | `metropolis.home.go` | Teleports the sender, or a permitted target player, to their home. |
|
||||||
- `/metropolis-plot-reserve <name> <minX> <minY> <minZ> <maxX> <maxY> <maxZ>` reserves coordinates; a player may instead provide a WorldEdit selection.
|
| `/metropolis-home-move <homeNumber> [playerName]` | `metropolis.home.move` | Selects one of a player's existing home regions. The player argument defaults to the sender. |
|
||||||
- `/metropolis-plot-go <plot-name> [player]` teleports to a plot.
|
| `/metropolis-home-evict <playerName>` | `metropolis.home.evict` | Removes the player's ownership from their selected home region. |
|
||||||
- `/metropolis-flag-reset` reapplies Metropolis protection flags.
|
| `/metropolis-plot-reserve <name> <minX> <minY> <minZ> <maxX> <maxY> <maxZ>` | `metropolis.plot.reserve` | Creates a named reservation from explicit bounds. A player can instead run `/metropolis-plot-reserve <name>` with a WorldEdit selection. |
|
||||||
|
| `/metropolis-plot-go <plotName> [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 <count>` | `metropolis.debug` | Generates test homes; intended for development servers. |
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ description = 'Metropolis'
|
|||||||
|
|
||||||
gitSemVer {
|
gitSemVer {
|
||||||
minimumVersion.set('0.5.0')
|
minimumVersion.set('0.5.0')
|
||||||
versionPrefix.set('')
|
versionPrefix.set('v')
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -44,8 +44,24 @@ MODRINTH_VERSION="${MODRINTH_VERSION:-${VERSION:-}}"
|
|||||||
if [[ -z "$MODRINTH_VERSION" ]]; then
|
if [[ -z "$MODRINTH_VERSION" ]]; then
|
||||||
MODRINTH_VERSION=$(cd "$PROJECT_ROOT" && ./gradlew -q properties --property version | sed -n 's/^version: //p' | head -n1)
|
MODRINTH_VERSION=$(cd "$PROJECT_ROOT" && ./gradlew -q properties --property version | sed -n 's/^version: //p' | head -n1)
|
||||||
fi
|
fi
|
||||||
MODRINTH_CHANGELOG="${MODRINTH_CHANGELOG:-Auto release via publish-modrinth.sh}"
|
generate_changelog() {
|
||||||
MODRINTH_GAME_VERSIONS="${MODRINTH_GAME_VERSIONS:-26.2}"
|
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_LOADERS="${MODRINTH_LOADERS:-paper}"
|
||||||
MODRINTH_VERSION_TYPE="${MODRINTH_VERSION_TYPE:-}"
|
MODRINTH_VERSION_TYPE="${MODRINTH_VERSION_TYPE:-}"
|
||||||
MODRINTH_FILE="${MODRINTH_FILE:-}"
|
MODRINTH_FILE="${MODRINTH_FILE:-}"
|
||||||
|
|||||||
Reference in New Issue
Block a user