From 25778a54f56c29c71ae9b3643b98643f598c0d12 Mon Sep 17 00:00:00 2001 From: Michael Gilardi <11632652+mgilardi@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:07:38 -0700 Subject: [PATCH 1/4] Rename BlueMinimap to BlueMapMini (0.3.0) D194: so its name starts with BlueMap like the other BlueMap add-ons. The plugin, jar, admin command, permissions and pack file are now BlueMapMini. The Java package and the share event's class keep their names, and the plugin answers to BlueMinimap too, so HouseRules keeps filtering shares without an update. blueminimap.* permissions are respected alongside bluemaphud.*, and a no under any name still wins for on-by-default nodes, so a children's group stopped from sharing stays stopped. The old folder is copied on first start. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 4 +- CLAUDE.md | 2 +- README.md | 69 +++++---- build.gradle.kts | 4 +- docs/26x-audit.md | 10 +- docs/decisions.md | 4 + docs/releases/v0.3.0.md | 13 ++ settings.gradle.kts | 2 +- ...imapPlugin.java => BlueMapMiniPlugin.java} | 15 +- .../com/extantape/blueminimap/Migration.java | 6 +- .../java/com/extantape/blueminimap/Perms.java | 39 ++++-- .../blueminimap/api/CoordinateShareEvent.java | 4 +- .../blueminimap/command/HudCommands.java | 37 ++--- .../blueminimap/config/HudConfig.java | 2 +- .../extantape/blueminimap/hud/HudManager.java | 8 +- .../blueminimap/pack/PackBuilder.java | 20 +-- .../blueminimap/pack/PackService.java | 22 +-- .../blueminimap/pack/PublicUrlCheck.java | 2 +- .../blueminimap/render/FontLayout.java | 2 +- .../blueminimap/share/ShareMenu.java | 4 +- .../blueminimap/share/ShareService.java | 14 +- .../extantape/blueminimap/theme/ThemeSet.java | 2 +- .../blueminimap/tiles/GridCache.java | 2 +- src/main/resources/config.yml | 20 +-- src/main/resources/paper-plugin.yml | 51 +++++-- .../extantape/blueminimap/MigrationTest.java | 32 ++--- .../com/extantape/blueminimap/PermsTest.java | 53 ++++--- .../com/extantape/blueminimap/RenderTest.java | 4 +- .../blueminimap/SimulatedClient.java | 6 +- test/live/README.md | 6 +- test/live/backoff.js | 14 +- .../conflict/src/main/resources/plugin.yml | 2 +- test/live/fontcheck/FontCheck.java | 2 +- .../blueminimap/livetest/Helper.java | 2 +- .../src/main/resources/paper-plugin.yml | 2 +- test/live/houserules.js | 12 +- test/live/lib.js | 10 +- test/live/package.json | 4 +- test/live/packurl.js | 26 ++-- test/live/run.sh | 10 +- test/live/storage.js | 20 +-- test/live/suite.js | 132 +++++++++--------- 43 files changed, 388 insertions(+), 309 deletions(-) create mode 100644 docs/releases/v0.3.0.md rename src/main/java/com/extantape/blueminimap/{BlueMinimapPlugin.java => BlueMapMiniPlugin.java} (95%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e97e820..33eb74f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,5 +28,5 @@ jobs: - run: ./gradlew build - uses: actions/upload-artifact@v4 with: - name: BlueMinimap + name: BlueMapMini path: build/libs/*.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e58d4d8..3cef0f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,5 +38,5 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh release create "$GITHUB_REF_NAME" build/libs/BlueMinimap-*.jar \ - --title "BlueMinimap $GITHUB_REF_NAME" --notes-file "docs/releases/$GITHUB_REF_NAME.md" + gh release create "$GITHUB_REF_NAME" build/libs/BlueMapMini-*.jar \ + --title "BlueMapMini $GITHUB_REF_NAME" --notes-file "docs/releases/$GITHUB_REF_NAME.md" diff --git a/CLAUDE.md b/CLAUDE.md index 3f79932..ce6ea56 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,4 +1,4 @@ -# BlueMinimap +# BlueMapMini Registered in the owner's ops process (`~/Code/ops`). Area: `minecraft-plugins` (lead: Minecraft: Plugins Lead). Added 2026-11-09 from the ops starter kit; the repo itself dates from 2026-11-07 (as BlueMapHUD). diff --git a/README.md b/README.md index 7b900b0..e88c6c6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# BlueMinimap +# BlueMapMini -BlueMinimap: a BlueMap minimap and coordinates HUD for Paper, rendered in game from [BlueMap](https://bluemap.bluecolored.de/)'s own tiles, with a fullscreen map too. It's an add-on to BlueMap, not a separate map: it needs BlueMap on the server and shows what BlueMap has rendered. It uses a small resource pack with its own namespace: no client mods, no shader overrides and no held map items. +BlueMapMini: a BlueMap minimap and coordinates HUD for Paper, rendered in game from [BlueMap](https://bluemap.bluecolored.de/)'s own tiles, with a fullscreen map too. It's an add-on to BlueMap, not a separate map: it needs BlueMap on the server and shows what BlueMap has rendered. It uses a small resource pack with its own namespace: no client mods, no shader overrides and no held map items. It's an unofficial add-on for BlueMap and isn't affiliated with BlueMap's authors. -**Status:** pre-release. It has passed a full test suite on live Paper 26.1.2, 26.2 and 26.3 servers with real BlueMap tiles, using a protocol bot. It hasn't been seen in a real game client yet. See [Testing](#testing). +**Status:** pre-release, version 0.3.0, renamed from BlueMinimap (see below). It has passed a full test suite on live Paper 26.1.2, 26.2 and 26.3 servers with real BlueMap tiles, using a protocol bot. It hasn't been seen in a real game client yet. See [Testing](#testing). - Requires Paper 26.1 or newer, Java 25, and a BlueMap version that matches your server (see below). Java Edition only. Paper 1.21.11 and older aren't supported. - Works alongside other resource packs, because it never overrides a shader and only adds its own files. @@ -19,15 +19,24 @@ These minimums come from BlueMap's release notes. Only BlueMap 5.29 was tested, ## Install -1. Put `BlueMinimap-.jar` in `plugins/`, next to BlueMap. +1. Put `BlueMapMini-.jar` in `plugins/`, next to BlueMap. 2. Open port `8164` so players can download the pack, or set `pack.public-url` to host it elsewhere. Servers sharing a machine each need their own `pack.port`. `pack.bind` picks the address it listens on (empty means every address); `127.0.0.1` keeps it on the server's own machine, for when the pack reaches players another way. -3. Start the server. Settings are in `plugins/BlueMinimap/config.yml`. +3. Start the server. Settings are in `plugins/BlueMapMini/config.yml`. If BlueMap stores its maps in SQL, set `tiles.source: http`. +## Upgrading from BlueMinimap + +BlueMapMini was called BlueMinimap in 0.2.x, and renamed in 0.3.0 (D194) so its name starts with BlueMap like the other BlueMap add-ons. Players keep their HUD settings. + +- With the server stopped, swap `BlueMinimap-0.2.1.jar` for `BlueMapMini-0.3.0.jar`. +- On first start, `plugins/BlueMinimap/` is copied to `plugins/BlueMapMini/` if that doesn't exist yet, so your config, themes and icons come across. The old folder is left untouched. The pack is rebuilt as `plugins/BlueMapMini/pack/bluemapmini-pack.zip`; if you host the pack yourself (`public-url`), upload the new file. +- It still answers to the name BlueMinimap, so HouseRules and anything else that looks for BlueMinimap keeps working without an update. The share event keeps its class, `com.extantape.blueminimap.api.CoordinateShareEvent`. +- For 0.3.x only, the old names still work: `/blueminimap` and the `blueminimap.*` permissions, alongside BlueMapHUD's. For permissions that are on by default, a "no" on any of the names wins, so a group you'd stopped from sharing stays stopped. Set the `bluemapmini.*` names instead. + ## Upgrading from BlueMapHUD -BlueMinimap was called BlueMapHUD up to 0.1.0, and renamed in 0.2.0. Players keep their HUD settings. +It was called BlueMapHUD up to 0.1.0, and BlueMinimap in 0.2.x. Players keep their HUD settings. - With the server stopped, swap `BlueMapHUD-0.1.0.jar` for `BlueMinimap-0.2.0.jar`. - On first start, `plugins/BlueMapHUD/` is copied to `plugins/BlueMinimap/` if that doesn't exist yet, so your config, themes and icons come across. The old folder is left untouched as a backup; nothing is overwritten. The pack is rebuilt as `plugins/BlueMinimap/pack/blueminimap-pack.zip`. If you host the pack yourself (`public-url`), upload the new file. @@ -52,25 +61,25 @@ BlueMinimap was called BlueMapHUD up to 0.1.0, and renamed in 0.2.0. Players kee | `/hud hide\|show shares` | Stops or restarts receiving coordinates other players share. | | `/hud theme`, `/hud theme \|default` | Lists the themes, with yours marked and each one clickable, or switches to one. `default` goes back to the server's. The choice is saved per player. | | `/hud mode coords\|map` | `coords` shows only the X, Y, Z and facing line, in the same bar, and works in worlds BlueMap doesn't map. `map` brings the minimap back. Both turn the HUD on, and `/hud mode` alone says which one you have. New players start in `hud.default-mode`, which is `map` unless the config says `coords`. | -| `/blueminimap help` | Shows help. | -| `/blueminimap reload` | Reloads the config, and re-sends the pack if it changed. | -| `/blueminimap debug` | Shows cache sizes, build times and update sizes. | -| `/blueminimap debug dump` | Writes your view to a PNG to compare with BlueMap. | -| `/blueminimap debug pattern` | Shows a test pattern. | -| `/blueminimap pack export` | Shows where the pack zip is, its SHA-1, and the address players are sent. | +| `/bluemapmini help` | Shows help. | +| `/bluemapmini reload` | Reloads the config, and re-sends the pack if it changed. | +| `/bluemapmini debug` | Shows cache sizes, build times and update sizes. | +| `/bluemapmini debug dump` | Writes your view to a PNG to compare with BlueMap. | +| `/bluemapmini debug pattern` | Shows a test pattern. | +| `/bluemapmini pack export` | Shows where the pack zip is, its SHA-1, and the address players are sent. | -If another plugin owns a name, BlueMinimap backs off: `/map` to `/worldmap`, then `/blueminimap map`, and `/hud` to `/minimap`, then `/blueminimap hud`. It logs which names it got. `/blueminimap map`, `/blueminimap hud`, `/blueminimap:map` and `/blueminimap:hud` always work. New names apply after a restart. +If another plugin owns a name, BlueMapMini backs off: `/map` to `/worldmap`, then `/bluemapmini map`, and `/hud` to `/minimap`, then `/bluemapmini hud`. It logs which names it got. `/bluemapmini map`, `/bluemapmini hud`, `/bluemapmini:map` and `/bluemapmini:hud` always work. New names apply after a restart. ## Permissions | Permission | Default | Allows | | --- | --- | --- | -| `blueminimap.use` | everyone | Seeing the map at all. Removing it hides everything for that group. | -| `blueminimap.fullscreen` | everyone | The fullscreen map. | -| `blueminimap.seeplayers` | everyone | Other players on the map. | -| `blueminimap.share.send` | everyone | Sharing your coordinates with `/hud share`. | -| `blueminimap.share.receive` | everyone | Receiving coordinates other players share. | -| `blueminimap.admin` | ops | `/blueminimap reload`, `debug` and `pack`. | +| `bluemapmini.use` | everyone | Seeing the map at all. Removing it hides everything for that group. | +| `bluemapmini.fullscreen` | everyone | The fullscreen map. | +| `bluemapmini.seeplayers` | everyone | Other players on the map. | +| `bluemapmini.share.send` | everyone | Sharing your coordinates with `/hud share`. | +| `bluemapmini.share.receive` | everyone | Receiving coordinates other players share. | +| `bluemapmini.admin` | ops | `/bluemapmini reload`, `debug` and `pack`. | ## Themes and the clock @@ -87,7 +96,7 @@ A theme sets the HUD's colours, the plate behind the coordinates and the look of The clock follows the coordinates as a small picture and 24-hour time, such as `18:30`. It changes every `hud.clock.step-minutes` in-game minutes, 5 by default, and its digits are fixed-width, so the line never shifts. It's hidden where time stands still, such as the Nether and the End. `hud.clock.enabled: false` turns it off for everyone, and `/hud hide clock` for one player. -**Your own theme.** Copy one of the files in [`src/main/resources/themes`](src/main/resources/themes) into `plugins/BlueMinimap/themes/`, rename it (lowercase, such as `ocean.json`), change it, and run `/blueminimap reload`. A file with a built-in theme's name replaces it. The file holds: +**Your own theme.** Copy one of the files in [`src/main/resources/themes`](src/main/resources/themes) into `plugins/BlueMapMini/themes/`, rename it (lowercase, such as `ocean.json`), change it, and run `/bluemapmini reload`. A file with a built-in theme's name replaces it. The file holds: - `name`: the name players see. - `colors`: `text`, `facing`, `time` and `legend` for text, `plate` for the plate, and `self`, `player`, `poi`, `death` and `north` for the map's icons. Each is `#RRGGBB`. @@ -101,23 +110,23 @@ Up to 8 themes fit in the pack. Every built-in theme passes the same readability `/hud share` sends your current coordinates to people you choose, as a chat message with the coordinates and the dimension, such as `Alex shared where they are: 120 64 -35 in the Overworld`. Clicking the numbers copies them. Nothing is shared unless a player asks, and there's no teleport link. -- **Who can receive:** by default, players in the sender's world, counting its `_nether` and `_the_end` as the same world, who can see the sender, have `blueminimap.share.receive`, and haven't turned shares off with `/hud hide shares`. +- **Who can receive:** by default, players in the sender's world, counting its `_nether` and `_the_end` as the same world, who can see the sender, have `bluemapmini.share.receive`, and haven't turned shares off with `/hud hide shares`. - **Feedback:** the sender is told exactly who got their coordinates, and who couldn't. - **Limits:** a player waits `share.cooldown-seconds` (30 by default) between shares, and each share is logged to the console. `share.enabled: false` turns sharing off. -**Your server's own rules.** BlueMinimap fires `com.extantape.blueminimap.api.CoordinateShareEvent` on the main thread before each share. It carries the sender, the world, the block coordinates and a mutable set of recipients. A plugin can remove recipients, for example to match who may chat with whom, or cancel the share. With `share.candidates: all-online`, recipients can include every player online, so that such a plugin can follow rules that reach across worlds. BlueMinimap only widens a share like that while a plugin is listening to the event, and logs a warning at startup if nothing is. To build against it, depend on BlueMinimap as a server dependency with `join-classpath: true` in your `paper-plugin.yml`. +**Your server's own rules.** BlueMapMini fires `com.extantape.blueminimap.api.CoordinateShareEvent` on the main thread before each share. It carries the sender, the world, the block coordinates and a mutable set of recipients. A plugin can remove recipients, for example to match who may chat with whom, or cancel the share. With `share.candidates: all-online`, recipients can include every player online, so that such a plugin can follow rules that reach across worlds. BlueMapMini only widens a share like that while a plugin is listening to the event, and logs a warning at startup if nothing is. To build against it, depend on BlueMapMini as a server dependency with `join-classpath: true` in your `paper-plugin.yml`. ## Resource packs The plugin sends its pack alongside any others using the multi-pack API, and players don't see a map until their client confirms it loaded. With `pack.required`, a player who declines the pack is kicked with `pack.kick-message`. A download that fails never kicks: the player plays without the map and is told why, admins are warned, and the pack is offered again when they change worlds or rejoin. Its only file outside its own namespace is a transparent boss bar texture, in pink by default. If another pack restyles that colour, set `pack.boss-bar-color` to one it leaves alone. -**Using it with Magic.** Magic sends its pack with Bukkit's older one-pack method, which clears every other server pack. BlueMinimap re-sends its pack once when that happens, but it's better to stop the conflict. In `plugins/Magic/config.yml` set `resource_pack: ""`, then add Magic's pack to your main pack. +**Using it with Magic.** Magic sends its pack with Bukkit's older one-pack method, which clears every other server pack. BlueMapMini re-sends its pack once when that happens, but it's better to stop the conflict. In `plugins/Magic/config.yml` set `resource_pack: ""`, then add Magic's pack to your main pack. -**Hosting it elsewhere.** Set `pack.public-url` to where you upload `plugins/BlueMinimap/pack/blueminimap-pack.zip`. Upload it unchanged, because re-zipping changes its SHA-1 and clients reject a pack whose hash doesn't match. `{sha1}` in the address is replaced with the pack's hash, such as `https://example.com/packs/{sha1}.zip`, so the address changes whenever the pack does. The same settings and plugin version always build the same hash. On startup and `/blueminimap reload` the plugin downloads the address once in the background and warns, with both hashes, if it isn't the current pack. It never blocks startup. If the server can't reach the address but players can, set `pack.verify-public-url: false`. `/blueminimap pack export` shows the path, the hash and the address players are sent. +**Hosting it elsewhere.** Set `pack.public-url` to where you upload `plugins/BlueMapMini/pack/bluemapmini-pack.zip`. Upload it unchanged, because re-zipping changes its SHA-1 and clients reject a pack whose hash doesn't match. `{sha1}` in the address is replaced with the pack's hash, such as `https://example.com/packs/{sha1}.zip`, so the address changes whenever the pack does. The same settings and plugin version always build the same hash. On startup and `/bluemapmini reload` the plugin downloads the address once in the background and warns, with both hashes, if it isn't the current pack. It never blocks startup. If the server can't reach the address but players can, set `pack.verify-public-url: false`. `/bluemapmini pack export` shows the path, the hash and the address players are sent. -**Using a merged pack.** Set `pack.send: false`, run `/blueminimap pack export`, and merge that zip into your server's pack. On startup the plugin warns if its files are missing. +**Using a merged pack.** Set `pack.send: false`, run `/bluemapmini pack export`, and merge that zip into your server's pack. On startup the plugin warns if its files are missing. -**Custom icons.** Put 9x9 PNGs in `plugins/BlueMinimap/icons/` and run `/blueminimap reload`. The names are `arrow_00.png` to `arrow_15.png` (clockwise from north), `player.png`, `poi.png`, `death.png` and `north.png`. Draw them in white, because the plugin tints them. +**Custom icons.** Put 9x9 PNGs in `plugins/BlueMapMini/icons/` and run `/bluemapmini reload`. The names are `arrow_00.png` to `arrow_15.png` (clockwise from north), `player.png`, `poi.png`, `death.png` and `north.png`. Draw them in white, because the plugin tints them. ## Known limits @@ -145,7 +154,7 @@ Measured in the test suite on a synthetic map: | Minimap update, 32x32 with 20 players, compressed | about 1.7 KB | 5 KB | | Fullscreen update, 96x54, compressed | about 4.5 KB | none | -Real terrain has more colour variation than the test map, so expect larger updates in play. `/blueminimap debug` reports sizes before compression. +Real terrain has more colour variation than the test map, so expect larger updates in play. `/bluemapmini debug` reports sizes before compression. ## Testing @@ -166,14 +175,14 @@ The live tests are in [`test/live`](test/live/README.md), with what they cover a - **Hiding:** vanish, `hidePlayer`, spectators, invisibility, players hidden in BlueMap, the radius, other dimensions, permissions, other boss bars, the Wither, the Ender Dragon and every `auto-hide` setting. - **Updates:** nothing is sent while idle apart from each clock step, and at most 4 updates a second otherwise. - **Pack handling:** required, optional and declined packs, failed downloads (no kick, a message, an admin warning and a retry on world change), `host`, `public-url` with and without `{sha1}`, the hosted-pack check (matching, stale, missing, unreachable, never answering, invalid and turned off), `send: false`, bar colours, custom icons, and another plugin wiping packs with the old one-pack method. -- **Life cycle:** `/blueminimap reload`, `/bluemap reload`, a full `/reload`, server restarts, saved settings and quick join/quits. +- **Life cycle:** `/bluemapmini reload`, `/bluemap reload`, a full `/reload`, server restarts, saved settings and quick join/quits. - **Bad data:** corrupt tiles, a wrong web root, an unreachable webserver and the far edge of the world. - **Other setups:** the action bar channel, the HTTP source, and command back-off from another plugin's `plugin.yml` commands. **Also passed:** - **SQL storage:** on 26.3, tiles held in SQLite through the HTTP source matched the same world rendered to files on all 1024 cells. -- **Startup:** BlueMap loaded on all 8 of 8 restarts of a 26.3 server with BlueMinimap installed. +- **Startup:** BlueMap loaded on all 8 of 8 restarts of a 26.3 server with BlueMapMini installed. - **Game code:** the Minecraft 26.1.2, 26.2 and 26.3 client code loads the generated pack and fonts, with the game's advances matching this project's for all 18,944 glyphs, the clock pictures and fixed-width time digits included. The 26.1, 26.1.1 and 26.1.2 clients all use resource pack format 84, the pack's minimum. **20 moving players, one minute, on real terrain.** 26.3 is this release, with themes and the clock; 26.1.2 and 26.2 were measured on the build just before them: @@ -195,7 +204,7 @@ These ran on a shared machine with other test servers running, so tick times var - ZigZag loaded alongside the pack in a client. It overlaps only on the pink boss bar textures, which this pack replaces. - A Bedrock join, including Floodgate detection through `paper-plugin.yml`'s classpath sharing, MySQL or PostgreSQL storage, and back-off from another plugin's Brigadier commands. -To check a real client, join as an op and run `/blueminimap debug pattern`. You should see a sharp colour gradient with a white border and no bar behind it. +To check a real client, join as an op and run `/bluemapmini debug pattern`. You should see a sharp colour gradient with a white border and no bar behind it. ## Building diff --git a/build.gradle.kts b/build.gradle.kts index d8476b3..425a366 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } group = "com.extantape" -version = "0.2.1" +version = "0.3.0" java { toolchain.languageVersion.set(JavaLanguageVersion.of(25)) @@ -52,6 +52,6 @@ tasks.test { } tasks.jar { - archiveBaseName.set("BlueMinimap") + archiveBaseName.set("BlueMapMini") from("LICENSE") } diff --git a/docs/26x-audit.md b/docs/26x-audit.md index 8a17715..2979e93 100644 --- a/docs/26x-audit.md +++ b/docs/26x-audit.md @@ -1,6 +1,6 @@ # 26.x audit -BlueMinimap is a Paper plugin for Paper 26.1 and newer only: `paper-plugin.yml`, `api-version: '26.1'`, Java 25, and the Paper 26.1.2 API at compile time. This note records what changed when 1.21.11 support was dropped and which newer Paper features were checked. Checked against docs.papermc.io on 2026-11-07. +BlueMapMini is a Paper plugin for Paper 26.1 and newer only: `paper-plugin.yml`, `api-version: '26.1'`, Java 25, and the Paper 26.1.2 API at compile time. This note records what changed when 1.21.11 support was dropped and which newer Paper features were checked. Checked against docs.papermc.io on 2026-11-07. ## What changed @@ -16,7 +16,7 @@ BlueMinimap is a Paper plugin for Paper 26.1 and newer only: `paper-plugin.yml`, Paper has no 26.1.0 build. Its 26.1 line is 26.1.1 (alpha builds only) and 26.1.2 (stable), so "26.1" in practice means 26.1.2. BlueMap 5.29 itself declares `api-version: 26.1.1`. -**`paper-plugin.yml`.** Paper still marks Paper plugins experimental, and its docs don't say whether one can use a `plugin.yml` plugin's classes. BlueMap is one, so this was tested rather than assumed. BlueMap is declared as a required server dependency that loads first with `join-classpath: true`. Floodgate is declared the same way but optional, because the plugin finds it by reflection. There is no `commands` section: the commands were already Brigadier, registered through `LifecycleEvents.COMMANDS`. Paper plugins get their own classloader, so other plugins can't reach BlueMinimap's classes. None need to. +**`paper-plugin.yml`.** Paper still marks Paper plugins experimental, and its docs don't say whether one can use a `plugin.yml` plugin's classes. BlueMap is one, so this was tested rather than assumed. BlueMap is declared as a required server dependency that loads first with `join-classpath: true`. Floodgate is declared the same way but optional, because the plugin finds it by reflection. There is no `commands` section: the commands were already Brigadier, registered through `LifecycleEvents.COMMANDS`. Paper plugins get their own classloader, so other plugins can't reach BlueMapMini's classes. None need to. **Java 25** found one real compile error: a cache record named `Entry` clashed with `LinkedHashMap.Entry` inside an anonymous subclass. It's renamed to `CachedTile`. @@ -46,10 +46,10 @@ All on 2026-11-07, with BlueMap 5.29. The 31 unit tests pass on Java 25. The tes | Load, 20 players for a minute | 9/9 | 9/9 | 9/9 | | `public-url` and the hosted-pack check | | | 36/36 | | BlueMap on SQLite through the HTTP source | | | 1024/1024 cells | -| BlueMap starting next to BlueMinimap | | | 8/8 starts | +| BlueMap starting next to BlueMapMini | | | 8/8 starts | -The live suite covers BlueMap's classes being reachable from the Paper plugin (tiles, markers, hidden players), commands and their back-off, `/blueminimap reload`, `/bluemap reload` and a full `/reload`. +The live suite covers BlueMap's classes being reachable from the Paper plugin (tiles, markers, hidden players), commands and their back-off, `/bluemapmini reload`, `/bluemap reload` and a full `/reload`. **Mocked or not tested:** the client is a protocol bot speaking 1.21.11 through ViaBackwards, not a real 26.x client. Magic's pack call is simulated with the same Bukkit method. Floodgate was not installed, so the optional `join-classpath` for it is untested. Paper 26.1.1, which only had alpha builds, was not tested. -**Found along the way:** `/blueminimap debug dump` could finish after the plugin was disabled and then try to schedule its reply, which threw an error. It now checks first, as frame building already did. +**Found along the way:** `/bluemapmini debug dump` could finish after the plugin was disabled and then try to schedule its reply, which threw an error. It now checks first, as frame building already did. diff --git a/docs/decisions.md b/docs/decisions.md index 23e7716..595dce2 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -20,3 +20,7 @@ Owner decisions for BlueMapHUD, newest first. | 2026-11-07 | Add `hud.default-mode: map\|coords` to `config.yml`, defaulting to `map`. | A server replacing a coordinates plugin can start new players on coordinates only. A player's own `/hud mode` choice always wins. | | 2026-11-06 | Add a coordinates-only mode (`/hud mode coords`) in the same single boss bar. | Players can keep coordinates without the map, so a server doesn't need a separate coordinates plugin. | - **Name (2026-11-08, owner):** BlueMapHUD is renamed BlueMinimap, one word in every place: repo, plugin name, jar, package, admin command and prose, described as "a BlueMap minimap and coordinates HUD for Paper, rendered in game", an add-on to BlueMap. Released as 0.2.0 together with HouseRules 0.2.0. Identifiers players' data depends on keep their old values for good: the saved-settings keys `bluemaphud:settings` and `bluemaphud:theme`, and the pack ID from `bluemaphud:pack`. Old commands and permissions work for one release; for default-on permissions a "no" on either name wins, so children's groups that were stopped from sharing stay stopped. With HouseRules older than 0.2, `/hud share` is turned off (fail closed). + +## 2026-11-14 + +- **Name (owner, D194):** BlueMinimap is renamed BlueMapMini, so it starts with BlueMap like BlueMapAuth and the other BlueMap add-ons. The owner chose "Rename to BlueMapMini (Recommended)". Released as 0.3.0. The Java package and the share event's class keep their names, and the plugin answers to BlueMinimap too, so HouseRules keeps filtering shares with no update. A "no" under any old permission name still wins, so a children's group stopped from sharing stays stopped. diff --git a/docs/releases/v0.3.0.md b/docs/releases/v0.3.0.md new file mode 100644 index 0000000..258ad70 --- /dev/null +++ b/docs/releases/v0.3.0.md @@ -0,0 +1,13 @@ +BlueMinimap is now BlueMapMini (D194), so its name starts with BlueMap like the other BlueMap add-ons. Nothing else changed in how it works. + +## Upgrading + +- Swap `BlueMinimap-0.2.1.jar` for `BlueMapMini-0.3.0.jar` with the server stopped. +- On first start, `plugins/BlueMinimap/` is copied to `plugins/BlueMapMini/` if that doesn't exist yet. The old folder stays as it was. +- It still answers to the name BlueMinimap, and the share event keeps its class, so HouseRules keeps filtering `/hud share` without an update. +- `/blueminimap` and the `blueminimap.*` permissions still work in 0.3.x. A "no" under any old name wins for permissions that are on by default, so a group stopped from sharing stays stopped. +- If you host the pack yourself, upload the rebuilt `plugins/BlueMapMini/pack/bluemapmini-pack.zip`. + +## Tested + +Unit tests pass, including a children's group whose `blueminimap.share.receive` was turned off staying off. The carry-over, the old name and HouseRules' share filter were checked on a throwaway server. diff --git a/settings.gradle.kts b/settings.gradle.kts index 4694de7..195011d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,4 @@ -rootProject.name = "BlueMinimap" +rootProject.name = "BlueMapMini" // Test-only plugins for the live tests in test/live. They're never shipped. include("live-test-helper", "live-test-conflict") diff --git a/src/main/java/com/extantape/blueminimap/BlueMinimapPlugin.java b/src/main/java/com/extantape/blueminimap/BlueMapMiniPlugin.java similarity index 95% rename from src/main/java/com/extantape/blueminimap/BlueMinimapPlugin.java rename to src/main/java/com/extantape/blueminimap/BlueMapMiniPlugin.java index c3eedcd..3e2fe5a 100644 --- a/src/main/java/com/extantape/blueminimap/BlueMinimapPlugin.java +++ b/src/main/java/com/extantape/blueminimap/BlueMapMiniPlugin.java @@ -46,7 +46,7 @@ import java.util.function.Consumer; import java.util.logging.Level; -public final class BlueMinimapPlugin extends JavaPlugin implements Listener { +public final class BlueMapMiniPlugin extends JavaPlugin implements Listener { /** Runs after other plugins, so the command name chains can see what they took. */ private static final int COMMANDS_PRIORITY = 1000; private static final long PACK_SEND_DELAY_TICKS = 20; @@ -67,10 +67,13 @@ public final class BlueMinimapPlugin extends JavaPlugin implements Listener { public void onEnable() { Perms.logTo(line -> getLogger().warning(line)); java.nio.file.Path folder = getDataFolder().toPath(); - String moved = Migration.copyIfMissing(folder.resolveSibling("BlueMapHUD"), folder); + // Renamed from BlueMinimap (D194, 0.3.0), and before that from BlueMapHUD: bring the newest old folder across once. + String moved = Migration.copyIfMissing(folder.resolveSibling("BlueMinimap"), folder); + if (moved == null) moved = Migration.copyIfMissing(folder.resolveSibling("BlueMapHUD"), folder); if (moved != null) { getLogger().warning(moved); - try { // The old pack file would only confuse whoever hosts the pack; the new one is built below. + try { // The old pack files would only confuse whoever hosts the pack; the new one is built below. + java.nio.file.Files.deleteIfExists(folder.resolve("pack/blueminimap-pack.zip")); java.nio.file.Files.deleteIfExists(folder.resolve("pack/bluemaphud-pack.zip")); } catch (java.io.IOException e) { getLogger().warning("Couldn't remove the copied old pack file: " + e.getMessage()); @@ -161,7 +164,7 @@ public void explainIfNoMap(Player player) { /** Coordinates need the pack but not a map, so this is all that can stop them appearing. */ public void explainIfNoPack(Player player) { if (!packs.ready(player)) { - player.sendMessage(Component.text("Your client hasn't loaded the BlueMinimap resource pack yet.", NamedTextColor.YELLOW)); + player.sendMessage(Component.text("Your client hasn't loaded the BlueMapMini resource pack yet.", NamedTextColor.YELLOW)); } } @@ -308,13 +311,13 @@ public void onSwapHands(PlayerSwapHandItemsEvent event) { if (!player.isSneaking() || hud.isBedrock(player)) return; HudSession session = hud.session(player); - if (config.hud().quickHideGesture() && player.getLocation().getPitch() >= LOOK_DOWN_PITCH && com.extantape.blueminimap.Perms.has(player, "blueminimap.use")) { + if (config.hud().quickHideGesture() && player.getLocation().getPitch() >= LOOK_DOWN_PITCH && com.extantape.blueminimap.Perms.has(player, "bluemapmini.use")) { event.setCancelled(true); session.settings().enabled = !session.settings().enabled; hud.saveSettings(player, session); return; } - if (config.fullscreen().sneakSwapToggle() && config.fullscreen().enabled() && com.extantape.blueminimap.Perms.has(player, "blueminimap.fullscreen")) { + if (config.fullscreen().sneakSwapToggle() && config.fullscreen().enabled() && com.extantape.blueminimap.Perms.has(player, "bluemapmini.fullscreen")) { event.setCancelled(true); toggleFullscreen(player); } diff --git a/src/main/java/com/extantape/blueminimap/Migration.java b/src/main/java/com/extantape/blueminimap/Migration.java index 4e5b6d4..4c26334 100644 --- a/src/main/java/com/extantape/blueminimap/Migration.java +++ b/src/main/java/com/extantape/blueminimap/Migration.java @@ -7,7 +7,7 @@ import java.nio.file.StandardCopyOption; import java.util.stream.Stream; -/** Carries a server's files over from the old plugin folder after the rename from BlueMapHUD (2026-11-09). */ +/** Carries a server's files over from the old plugin folder after a rename: from BlueMinimap (D194, 2026-11-14) or from BlueMapHUD (2026-11-09). */ final class Migration { private Migration() {} @@ -33,10 +33,10 @@ static String copyIfMissing(Path old, Path now) { } Files.move(tmp, now, StandardCopyOption.ATOMIC_MOVE); return "Copied plugins/" + old.getFileName() + " to plugins/" + now.getFileName() - + " (BlueMapHUD is now called BlueMinimap). The old folder was left untouched; delete it once you're happy."; + + " (" + old.getFileName() + " is now called BlueMapMini). The old folder was left untouched; delete it once you're happy."; } catch (IOException | UncheckedIOException e) { return "Couldn't copy plugins/" + old.getFileName() + " to plugins/" + now.getFileName() + ": " + e.getMessage() - + ". Copy it by hand while the server is stopped, or BlueMinimap starts with a fresh config."; + + ". Copy it by hand while the server is stopped, or BlueMapMini starts with a fresh config."; } } diff --git a/src/main/java/com/extantape/blueminimap/Perms.java b/src/main/java/com/extantape/blueminimap/Perms.java index 1520c19..c82b93e 100644 --- a/src/main/java/com/extantape/blueminimap/Perms.java +++ b/src/main/java/com/extantape/blueminimap/Perms.java @@ -8,20 +8,20 @@ import java.util.function.Consumer; /** - * Permission checks that still respect the names from before the rename to BlueMinimap (2026-11-09), for one - * release (0.2.x): {@code bluemaphud.use} alongside {@code blueminimap.use}, and so on. The old nodes are declared - * with their old defaults, so on a server that never touched them both names agree. + * Permission checks that still respect the plugin's earlier names: {@code blueminimap.*} (its name until 0.2.x, renamed + * BlueMapMini in 0.3.0, D194) and {@code bluemaphud.*} (its name before 2026-11-09). The old nodes are declared with + * their old defaults, so on a server that never touched them every name agrees. * *

Most nodes are on by default, so the old names matter most where a server turned one off, for example - * {@code bluemaphud.share.send: false} for a children's group. That must stay off after the upgrade. So for nodes + * {@code blueminimap.share.send: false} for a children's group. That must stay off after the upgrade. So for nodes * that are on by default, a "no" on either name wins. For {@code admin}, which is for operators only by default, a * "yes" on either name wins, so admins keep their tools. Whenever the old name is what decided the answer, that's * logged once per player and node, saying what to change. */ public final class Perms { /** Nodes that are on by default, where a deny on either name wins. Everything else: a grant on either wins. */ - static final Set ON_BY_DEFAULT = Set.of("blueminimap.use", "blueminimap.fullscreen", "blueminimap.seeplayers", - "blueminimap.share.send", "blueminimap.share.receive"); + static final Set ON_BY_DEFAULT = Set.of("bluemapmini.use", "bluemapmini.fullscreen", "bluemapmini.seeplayers", + "bluemapmini.share.send", "bluemapmini.share.receive"); private static final Set warned = ConcurrentHashMap.newKeySet(); private static volatile Consumer warn = line -> {}; @@ -29,22 +29,31 @@ private Perms() {} public static void logTo(Consumer sink) { warn = sink; } + /** The earlier names, newest first. */ + static final java.util.List OLD_PREFIXES = java.util.List.of("blueminimap.", "bluemaphud."); + public static String oldName(String node) { - return "bluemaphud." + node.substring("blueminimap.".length()); + return OLD_PREFIXES.getFirst() + node.substring("bluemapmini.".length()); } public static boolean has(Permissible who, String node) { boolean now = who.hasPermission(node); - if (!node.startsWith("blueminimap.")) return now; - String old = oldName(node); - boolean then = who.hasPermission(old); - if (now == then) return now; - boolean result = ON_BY_DEFAULT.contains(node) ? now && then : now || then; - if (result == now) return result; // the old name changed nothing, so there's nothing to tell anyone + if (!node.startsWith("bluemapmini.")) return now; + boolean onByDefault = ON_BY_DEFAULT.contains(node); + boolean result = now; + String decidedBy = null; + for (String prefix : OLD_PREFIXES) { + String old = prefix + node.substring("bluemapmini.".length()); + boolean then = who.hasPermission(old); + boolean next = onByDefault ? result && then : result || then; + if (next != result && decidedBy == null) decidedBy = old + " " + then; + result = next; + } + if (result == now) return result; // the old names changed nothing, so there's nothing to tell anyone String name = who instanceof CommandSender cs ? cs.getName() : String.valueOf(who); if (warned.add(name + " " + node)) - warn.accept(name + " has " + node + " " + now + " but the old " + old + " " + then + ", so it's " + result - + ". The old name is still respected in 0.2.x but goes in the next release: set " + node + " instead."); + warn.accept(name + " has " + node + " " + now + " but the old " + decidedBy + ", so it's " + result + + ". The old names are still respected in 0.3.x but go in the next release: set " + node + " instead."); return result; } } diff --git a/src/main/java/com/extantape/blueminimap/api/CoordinateShareEvent.java b/src/main/java/com/extantape/blueminimap/api/CoordinateShareEvent.java index 76dc04e..d61a751 100644 --- a/src/main/java/com/extantape/blueminimap/api/CoordinateShareEvent.java +++ b/src/main/java/com/extantape/blueminimap/api/CoordinateShareEvent.java @@ -11,10 +11,10 @@ /** * Fired on the main thread just before a player's coordinates are shared, so that another plugin, such as a * server's chat rules, can decide who may receive them. Remove recipients to narrow the share, or cancel it - * to send nothing. Players who turned shares off, or lack {@code blueminimap.share.receive}, are already gone. + * to send nothing. Players who turned shares off, or lack {@code bluemapmini.share.receive}, are already gone. * *

When {@code share.candidates} is {@code all-online}, the recipients can include players in other - * worlds, and BlueMinimap only does that while at least one plugin listens to this event. + * worlds, and BlueMapMini only does that while at least one plugin listens to this event. */ public final class CoordinateShareEvent extends Event implements Cancellable { private static final HandlerList HANDLERS = new HandlerList(); diff --git a/src/main/java/com/extantape/blueminimap/command/HudCommands.java b/src/main/java/com/extantape/blueminimap/command/HudCommands.java index dfbf05f..28b5a6e 100644 --- a/src/main/java/com/extantape/blueminimap/command/HudCommands.java +++ b/src/main/java/com/extantape/blueminimap/command/HudCommands.java @@ -1,6 +1,6 @@ package com.extantape.blueminimap.command; -import com.extantape.blueminimap.BlueMinimapPlugin; +import com.extantape.blueminimap.BlueMapMiniPlugin; import com.extantape.blueminimap.config.HudConfig; import com.extantape.blueminimap.hud.HudManager; import com.extantape.blueminimap.hud.HudSession; @@ -32,19 +32,20 @@ /** Registers /map, /hud and /blueminimap, backing off to the next name when one is already taken. */ public final class HudCommands { - private final BlueMinimapPlugin plugin; + private final BlueMapMiniPlugin plugin; /** Names chosen at startup. Data pack reloads rebuild the tree and must not back off from themselves. */ private String claimedMap; private String claimedHud; - public HudCommands(BlueMinimapPlugin plugin) { + public HudCommands(BlueMapMiniPlugin plugin) { this.plugin = plugin; } public void register(Commands commands, HudConfig config) { - commands.register(adminTree("blueminimap").build(), "BlueMinimap help and admin commands", List.of()); - // The old name, for one release (0.2.x) after the rename from BlueMapHUD. Logged at startup. - commands.register(adminTree("bmhud").build(), "Old name for /blueminimap. Goes in the next release.", List.of()); + commands.register(adminTree("bluemapmini").build(), "BlueMapMini help and admin commands", List.of()); + // The old names: /blueminimap (0.2.x, D194) and /bmhud (BlueMapHUD). Both go in the next release. + commands.register(adminTree("blueminimap").build(), "Old name for /bluemapmini. Goes in the next release.", List.of()); + commands.register(adminTree("bmhud").build(), "Old name for /bluemapmini. Goes in the next release.", List.of()); registerShortNames(commands, config); } @@ -55,7 +56,7 @@ private LiteralArgumentBuilder adminTree(String label) { .then(hudTree(Commands.literal("hud"))) .then(Commands.literal("reload").requires(HudCommands::isAdmin).executes(ctx -> { plugin.reload(); - return reply(ctx.getSource().getSender(), "BlueMinimap reloaded. Command names change after a restart."); + return reply(ctx.getSource().getSender(), "BlueMapMini reloaded. Command names change after a restart."); })) .then(Commands.literal("debug").requires(HudCommands::isAdmin) .executes(ctx -> reply(ctx.getSource().getSender(), plugin.debugLine())) @@ -73,12 +74,12 @@ private void registerShortNames(Commands commands, HudConfig config) { claimedMap = claim(commands, claimedMap != null ? List.of(claimedMap) : config.commands().mapNames(), "Open the fullscreen map", true, firstTime); claimedHud = claim(commands, claimedHud != null ? List.of(claimedHud) : config.commands().hudNames(), "Control the minimap", false, firstTime); // Namespaced names always exist, so a taken short name never locks anyone out. - addNamespaced(commands, "map", claimedMap, mapTree(Commands.literal("blueminimap:map"))); - addNamespaced(commands, "hud", claimedHud, hudTree(Commands.literal("blueminimap:hud"))); + addNamespaced(commands, "map", claimedMap, mapTree(Commands.literal("bluemapmini:map"))); + addNamespaced(commands, "hud", claimedHud, hudTree(Commands.literal("bluemapmini:hud"))); addNamespaced(commands, "map", claimedMap, mapTree(Commands.literal("bluemaphud:map"))); // old names, 0.2.x only addNamespaced(commands, "hud", claimedHud, hudTree(Commands.literal("bluemaphud:hud"))); - plugin.getLogger().info("/bmhud, /bluemaphud:map and /bluemaphud:hud are the old names for /blueminimap, /blueminimap:map and /blueminimap:hud. They still work in 0.2.x but go in the next release."); - plugin.getLogger().info("Commands: fullscreen map is " + describe(claimedMap, "/blueminimap map") + ", minimap is " + describe(claimedHud, "/blueminimap hud") + "."); + plugin.getLogger().info("/bmhud, /bluemaphud:map and /bluemaphud:hud are the old names for /blueminimap, /bluemapmini:map and /bluemapmini:hud. They still work in 0.2.x but go in the next release."); + plugin.getLogger().info("Commands: fullscreen map is " + describe(claimedMap, "/bluemapmini map") + ", minimap is " + describe(claimedHud, "/bluemapmini hud") + "."); } private String claim(Commands commands, List names, String description, boolean isMap, boolean checkLegacy) { @@ -107,11 +108,11 @@ private static String describe(String claimed, String fallback) { } private static boolean isAdmin(CommandSourceStack source) { - return com.extantape.blueminimap.Perms.has(source.getSender(), "blueminimap.admin"); + return com.extantape.blueminimap.Perms.has(source.getSender(), "bluemapmini.admin"); } private LiteralArgumentBuilder mapTree(LiteralArgumentBuilder root) { - return root.requires(source -> com.extantape.blueminimap.Perms.has(source.getSender(), "blueminimap.fullscreen")) + return root.requires(source -> com.extantape.blueminimap.Perms.has(source.getSender(), "bluemapmini.fullscreen")) .executes(player((p, s) -> plugin.toggleFullscreen(p))) .then(Commands.literal("zoom").then(Commands.argument("level", StringArgumentType.word()) .suggests((ctx, builder) -> suggestZoom(builder)) @@ -128,7 +129,7 @@ private LiteralArgumentBuilder mapTree(LiteralArgumentBuilde } private LiteralArgumentBuilder hudTree(LiteralArgumentBuilder root) { - return root.requires(source -> com.extantape.blueminimap.Perms.has(source.getSender(), "blueminimap.use")) + return root.requires(source -> com.extantape.blueminimap.Perms.has(source.getSender(), "bluemapmini.use")) .executes(player((p, s) -> setEnabled(p, s, !s.settings().enabled))) .then(Commands.literal("on").executes(player((p, s) -> setEnabled(p, s, true)))) .then(Commands.literal("off").executes(player((p, s) -> setEnabled(p, s, false)))) @@ -265,7 +266,7 @@ private void listThemes(Player player, HudSession session) { boolean mine = i == current; Component name = Component.text(theme.name(), mine ? NamedTextColor.WHITE : NamedTextColor.AQUA) .decoration(TextDecoration.UNDERLINED, !mine) - .clickEvent(ClickEvent.runCommand("/blueminimap:hud theme " + theme.id())) + .clickEvent(ClickEvent.runCommand("/bluemapmini:hud theme " + theme.id())) .hoverEvent(HoverEvent.showText(Component.text(mine ? "Your theme" : "Switch to " + theme.name()))); line = line.append(name).append(Component.text(mine ? " (yours)" : "", NamedTextColor.GRAY)) .append(Component.text(i + 1 < themes.size() ? ", " : "", NamedTextColor.GRAY)); @@ -359,12 +360,12 @@ private int withPlayer(CommandContext ctx, BiConsumer. Sneak + F also opens it.")); sender.sendMessage(Component.text("Minimap: on, off, mode map or coords, zoom, size, offset, corner, theme, hide and show (coords, players, markers, clock, shares).")); sender.sendMessage(Component.text("Share your coordinates: /hud share, /hud share or /hud share everyone.")); - if (com.extantape.blueminimap.Perms.has(sender, "blueminimap.admin")) { - sender.sendMessage(Component.text("Admin: /blueminimap reload, debug, debug dump, debug pattern, pack export.")); + if (com.extantape.blueminimap.Perms.has(sender, "bluemapmini.admin")) { + sender.sendMessage(Component.text("Admin: /bluemapmini reload, debug, debug dump, debug pattern, pack export.")); sender.sendMessage(Component.text(hud.debugLine())); } return Command.SINGLE_SUCCESS; diff --git a/src/main/java/com/extantape/blueminimap/config/HudConfig.java b/src/main/java/com/extantape/blueminimap/config/HudConfig.java index f58174a..ca7e103 100644 --- a/src/main/java/com/extantape/blueminimap/config/HudConfig.java +++ b/src/main/java/com/extantape/blueminimap/config/HudConfig.java @@ -121,7 +121,7 @@ public static HudConfig from(FileConfiguration c) { Pack pack = new Pack( c.getBoolean("pack.send", true), c.getBoolean("pack.required", true), - c.getString("pack.kick-message", "This server needs the BlueMinimap resource pack."), + c.getString("pack.kick-message", "This server needs the BlueMapMini resource pack."), c.getString("pack.prompt", ""), c.getInt("pack.port", 8164), c.getString("pack.bind", "").trim(), diff --git a/src/main/java/com/extantape/blueminimap/hud/HudManager.java b/src/main/java/com/extantape/blueminimap/hud/HudManager.java index b58e209..ca2d880 100644 --- a/src/main/java/com/extantape/blueminimap/hud/HudManager.java +++ b/src/main/java/com/extantape/blueminimap/hud/HudManager.java @@ -46,7 +46,7 @@ public final class HudManager { private final Map worldMaps = new HashMap<>(); private final Map bedrock = new ConcurrentHashMap<>(); private final ExecutorService builders = Executors.newFixedThreadPool(2, runnable -> { - Thread thread = new Thread(runnable, "BlueMinimap-build"); + Thread thread = new Thread(runnable, "BlueMapMini-build"); thread.setDaemon(true); thread.setPriority(Thread.NORM_PRIORITY - 1); return thread; @@ -183,7 +183,7 @@ private void tick() { String mapId = mapFor(player.getWorld()); boolean hasMap = !mapId.isEmpty() || session.pattern; - boolean canFull = hasMap && session.fullscreen && com.extantape.blueminimap.Perms.has(player, "blueminimap.fullscreen") && config.fullscreen().enabled(); + boolean canFull = hasMap && session.fullscreen && com.extantape.blueminimap.Perms.has(player, "bluemapmini.fullscreen") && config.fullscreen().enabled(); if (!shouldShow(player, session, hasMap, canFull)) { hide(player, session); continue; @@ -200,7 +200,7 @@ private boolean shouldShow(Player player, HudSession session, boolean hasMap, bo boolean coordsOnly = session.settings.coordsOnly && !session.pattern; if (!hasMap && !coordsOnly) return false; // A dimension BlueMap doesn't map. Coordinates don't need one. if (isBedrock(player) || !packs.ready(player)) return false; - if (!com.extantape.blueminimap.Perms.has(player, "blueminimap.use")) return false; + if (!com.extantape.blueminimap.Perms.has(player, "bluemapmini.use")) return false; if (canFull) return true; // Fullscreen is an explicit request, and it works while the minimap is off. if (!session.settings.enabled) return false; if (session.fullscreen && config.hud().hideWhileFullscreen() && !coordsOnly) return false; @@ -253,7 +253,7 @@ private int clockMinutes(World world, PlayerSettings settings) { } private int[] visiblePlayers(Player viewer, HudSession session, Location at) { - if (!session.settings.showPlayers || !com.extantape.blueminimap.Perms.has(viewer, "blueminimap.seeplayers")) return new int[0]; + if (!session.settings.showPlayers || !com.extantape.blueminimap.Perms.has(viewer, "bluemapmini.seeplayers")) return new int[0]; HudConfig.Players rules = config.players(); BlueMapAPI api = rules.hideBlueMapHidden() ? BlueMapAPI.getInstance().orElse(null) : null; double radiusSquared = (double) rules.radius() * rules.radius(); diff --git a/src/main/java/com/extantape/blueminimap/pack/PackBuilder.java b/src/main/java/com/extantape/blueminimap/pack/PackBuilder.java index e681c1a..9210988 100644 --- a/src/main/java/com/extantape/blueminimap/pack/PackBuilder.java +++ b/src/main/java/com/extantape/blueminimap/pack/PackBuilder.java @@ -28,7 +28,7 @@ import java.util.zip.ZipOutputStream; /** - * Generates the resource pack in memory. Everything lives under the blueminimap namespace, apart from + * Generates the resource pack in memory. Everything lives under the bluemapmini namespace, apart from * the optional transparent boss bar textures. No shaders are involved. */ public final class PackBuilder { @@ -67,7 +67,7 @@ public static Built build(HudConfig config, HudFonts fonts, IconSet icons) throw private static byte[] packMeta() { JsonObject pack = new JsonObject(); - pack.addProperty("description", "BlueMinimap minimap"); + pack.addProperty("description", "BlueMapMini minimap"); pack.addProperty("min_format", MIN_FORMAT); pack.addProperty("max_format", MAX_FORMAT); JsonObject root = new JsonObject(); @@ -81,18 +81,18 @@ private static void addLayout(Map files, FontLayout layout, Icon int iconCells = FontLayout.paddedCells(layout.maxIconAscent(), 1, HudIcon.SIZE); int textCells = FontLayout.paddedCells(layout.maxTextAscent(), 1, TinyFont.HEIGHT); - files.put("assets/blueminimap/textures/font/" + name + "_runs.png", png(runSheet(runCells))); - files.put("assets/blueminimap/textures/font/" + name + "_icons.png", png(iconSheet(icons, iconCells))); - files.put("assets/blueminimap/textures/font/" + name + "_text.png", png(textSheet(textCells))); + files.put("assets/bluemapmini/textures/font/" + name + "_runs.png", png(runSheet(runCells))); + files.put("assets/bluemapmini/textures/font/" + name + "_icons.png", png(iconSheet(icons, iconCells))); + files.put("assets/bluemapmini/textures/font/" + name + "_text.png", png(textSheet(textCells))); int readoutCells = FontLayout.paddedCells(layout.maxReadoutAscent(), 1, ReadoutFont.HEIGHT); int plateCells = FontLayout.paddedCells(layout.maxPlateAscent(), 1, FontLayout.PLATE_HEIGHT); - files.put("assets/blueminimap/textures/font/" + name + "_readout.png", png(readoutSheet(readoutCells))); + files.put("assets/bluemapmini/textures/font/" + name + "_readout.png", png(readoutSheet(readoutCells))); // One plate sheet for each opacity the themes use. The colour comes from the frame. for (int v = 0; v < themes.plateOpacities().size(); v++) { - files.put("assets/blueminimap/textures/font/" + name + "_plate" + v + ".png", png(plateSheet(plateCells, themes.plateOpacities().get(v)))); + files.put("assets/bluemapmini/textures/font/" + name + "_plate" + v + ".png", png(plateSheet(plateCells, themes.plateOpacities().get(v)))); } int clockCells = FontLayout.paddedCells(layout.maxClockAscent(), 1, Theme.CLOCK_SIZE); - files.put("assets/blueminimap/textures/font/" + name + "_clock.png", png(clockSheet(themes, clockCells))); + files.put("assets/bluemapmini/textures/font/" + name + "_clock.png", png(clockSheet(themes, clockCells))); JsonArray providers = new JsonArray(); providers.add(spaceProvider()); @@ -123,7 +123,7 @@ private static void addLayout(Map files, FontLayout layout, Icon } JsonObject font = new JsonObject(); font.add("providers", providers); - files.put("assets/blueminimap/font/" + name + ".json", GSON.toJson(font).getBytes(StandardCharsets.UTF_8)); + files.put("assets/bluemapmini/font/" + name + ".json", GSON.toJson(font).getBytes(StandardCharsets.UTF_8)); } private static JsonObject spaceProvider() { @@ -141,7 +141,7 @@ private static JsonObject spaceProvider() { private static JsonObject bitmap(String file, int height, int ascent, String[] chars) { JsonObject provider = new JsonObject(); provider.addProperty("type", "bitmap"); - provider.addProperty("file", "blueminimap:font/" + file + ".png"); + provider.addProperty("file", "bluemapmini:font/" + file + ".png"); provider.addProperty("height", height); provider.addProperty("ascent", ascent); JsonArray rows = new JsonArray(); diff --git a/src/main/java/com/extantape/blueminimap/pack/PackService.java b/src/main/java/com/extantape/blueminimap/pack/PackService.java index e752f08..a7bef36 100644 --- a/src/main/java/com/extantape/blueminimap/pack/PackService.java +++ b/src/main/java/com/extantape/blueminimap/pack/PackService.java @@ -67,7 +67,7 @@ public boolean install(HudConfig.Pack config, PackBuilder.Built built) throws IO this.pack = built; Files.createDirectories(packFolder); Files.write(exportPath(), built.zip()); - servedPath = "/blueminimap-" + built.sha1Hex() + ".zip"; + servedPath = "/bluemapmini-" + built.sha1Hex() + ".zip"; servedBytes = built.zip(); if (config.send() && config.publicUrl().isBlank()) startServer(config.port(), config.bind()); else stopServer(); @@ -83,13 +83,13 @@ public String publicUrl() { return PublicUrlCheck.fill(config.publicUrl(), pack.sha1Hex()); } - /** The last public-url check's result, for /blueminimap debug. */ + /** The last public-url check's result, for /bluemapmini debug. */ public String publicUrlStatus() { return publicUrlStatus; } public Path exportPath() { - return packFolder.resolve("blueminimap-pack.zip"); + return packFolder.resolve("bluemapmini-pack.zip"); } public String sha1() { @@ -118,15 +118,15 @@ private void reportFailure(Player player, PlayerResourcePackStatusEvent.Status s + "It'll try again when you change worlds or rejoin.", NamedTextColor.YELLOW)); String reason = status == PlayerResourcePackStatusEvent.Status.INVALID_URL ? "the address was invalid" : status == PlayerResourcePackStatusEvent.Status.FAILED_RELOAD ? "it didn't load" : "the download failed"; - plugin.getLogger().warning(player.getName() + " didn't get the BlueMinimap pack: " + reason + ". They're playing without the map." - + " Check the pack's hosting; /blueminimap pack export shows the address players are sent."); + plugin.getLogger().warning(player.getName() + " didn't get the BlueMapMini pack: " + reason + ". They're playing without the map." + + " Check the pack's hosting; /bluemapmini pack export shows the address players are sent."); long now = System.currentTimeMillis(); if (now - lastAdminWarning < ADMIN_WARNING_GAP_MILLIS) return; lastAdminWarning = now; - Component warning = Component.text("[BlueMinimap] " + player.getName() + " couldn't download the map's pack (" + reason - + "). Check the pack's hosting. /blueminimap pack export shows the address.", NamedTextColor.GOLD); + Component warning = Component.text("[BlueMapMini] " + player.getName() + " couldn't download the map's pack (" + reason + + "). Check the pack's hosting. /bluemapmini pack export shows the address.", NamedTextColor.GOLD); for (Player admin : Bukkit.getOnlinePlayers()) { - if (com.extantape.blueminimap.Perms.has(admin, "blueminimap.admin")) admin.sendMessage(warning); + if (com.extantape.blueminimap.Perms.has(admin, "bluemapmini.admin")) admin.sendMessage(warning); } } @@ -218,7 +218,7 @@ private void startServer(int port, String bind) throws IOException { + " Players elsewhere need pack.public-url (or pack.send: false with the files merged into your own pack)."); } server.setExecutor(Executors.newFixedThreadPool(2, runnable -> { - Thread thread = new Thread(runnable, "BlueMinimap-pack"); + Thread thread = new Thread(runnable, "BlueMapMini-pack"); thread.setDaemon(true); return thread; })); @@ -295,14 +295,14 @@ private void checkMergedPackAsync() { boolean found = false; try (ZipInputStream zip = new ZipInputStream(response.body())) { for (ZipEntry entry; (entry = zip.getNextEntry()) != null; ) { - if (entry.getName().equals("assets/blueminimap/font/hud.json")) { + if (entry.getName().equals("assets/bluemapmini/font/hud.json")) { found = true; break; } } } if (!found) { - plugin.getLogger().warning("The server's resource pack doesn't contain BlueMinimap's files. Merge " + exportPath() + " into it."); + plugin.getLogger().warning("The server's resource pack doesn't contain BlueMapMini's files. Merge " + exportPath() + " into it."); } } catch (IOException | RuntimeException e) { plugin.getLogger().warning("Could not check the server's resource pack: " + e.getMessage()); diff --git a/src/main/java/com/extantape/blueminimap/pack/PublicUrlCheck.java b/src/main/java/com/extantape/blueminimap/pack/PublicUrlCheck.java index f9e8839..dd5a565 100644 --- a/src/main/java/com/extantape/blueminimap/pack/PublicUrlCheck.java +++ b/src/main/java/com/extantape/blueminimap/pack/PublicUrlCheck.java @@ -48,7 +48,7 @@ public static Result check(String url, String expectedSha1, Duration timeout) { } return new Result(false, "The file at pack.public-url doesn't match the pack this plugin built. Hosted SHA-1 " + actual + ", built " + expectedSha1 + ". Players will fail the download" + kickNote() - + ". Upload plugins/BlueMinimap/pack/blueminimap-pack.zip unchanged to " + url + "."); + + ". Upload plugins/BlueMapMini/pack/bluemapmini-pack.zip unchanged to " + url + "."); } } catch (IllegalArgumentException e) { return new Result(false, "pack.public-url isn't a valid address: " + url); diff --git a/src/main/java/com/extantape/blueminimap/render/FontLayout.java b/src/main/java/com/extantape/blueminimap/render/FontLayout.java index a402ab3..ce610dc 100644 --- a/src/main/java/com/extantape/blueminimap/render/FontLayout.java +++ b/src/main/java/com/extantape/blueminimap/render/FontLayout.java @@ -61,7 +61,7 @@ public FontLayout(String name, int layoutIndex, int step, int rows, int reserved public FontLayout(String name, int layoutIndex, int step, int rows, int reservedRows, Direction direction, int plateVariants, int clockGlyphs, int onlyReadoutRow) { this.name = name; - this.font = Key.key("blueminimap", name); + this.font = Key.key("bluemapmini", name); this.layoutIndex = layoutIndex; this.step = step; this.rows = rows; diff --git a/src/main/java/com/extantape/blueminimap/share/ShareMenu.java b/src/main/java/com/extantape/blueminimap/share/ShareMenu.java index 67bdccb..9a02175 100644 --- a/src/main/java/com/extantape/blueminimap/share/ShareMenu.java +++ b/src/main/java/com/extantape/blueminimap/share/ShareMenu.java @@ -120,9 +120,9 @@ private void onMainThread(Runnable task) { /** One line per person to click, and one for everyone. */ private static void chatList(Player sender, List candidates) { sender.sendMessage(Component.text("Share your coordinates with:", NamedTextColor.GRAY)); - sender.sendMessage(link("Everyone here (" + candidates.size() + ")", "/blueminimap:hud share everyone")); + sender.sendMessage(link("Everyone here (" + candidates.size() + ")", "/bluemapmini:hud share everyone")); for (Player player : candidates.subList(0, Math.min(MAX_LISTED, candidates.size()))) { - sender.sendMessage(link(player.getName(), "/blueminimap:hud share " + player.getName())); + sender.sendMessage(link(player.getName(), "/bluemapmini:hud share " + player.getName())); } } diff --git a/src/main/java/com/extantape/blueminimap/share/ShareService.java b/src/main/java/com/extantape/blueminimap/share/ShareService.java index 568ad23..5764aa7 100644 --- a/src/main/java/com/extantape/blueminimap/share/ShareService.java +++ b/src/main/java/com/extantape/blueminimap/share/ShareService.java @@ -1,6 +1,6 @@ package com.extantape.blueminimap.share; -import com.extantape.blueminimap.BlueMinimapPlugin; +import com.extantape.blueminimap.BlueMapMiniPlugin; import com.extantape.blueminimap.api.CoordinateShareEvent; import com.extantape.blueminimap.config.HudConfig; import net.kyori.adventure.text.Component; @@ -28,14 +28,14 @@ * players can turn receiving off. Other plugins can narrow or stop any share through {@link CoordinateShareEvent}. */ public final class ShareService { - public static final String SEND = "blueminimap.share.send"; - public static final String RECEIVE = "blueminimap.share.receive"; + public static final String SEND = "bluemapmini.share.send"; + public static final String RECEIVE = "bluemapmini.share.receive"; - private final BlueMinimapPlugin plugin; + private final BlueMapMiniPlugin plugin; /** When each player last shared. Kept across rejoins, so leaving can't skip the cooldown. */ private final Map lastShare = new HashMap<>(); - public ShareService(BlueMinimapPlugin plugin) { + public ShareService(BlueMapMiniPlugin plugin) { this.plugin = plugin; } @@ -186,7 +186,7 @@ private static String place(World world) { /** * HouseRules 0.1.x listens for the share event under BlueMapHUD's old name, so it wouldn't see shares from - * BlueMinimap and they'd skip its chat circles. Fail closed: no shares until HouseRules is 0.2 or newer. + * BlueMapMini and they'd skip its chat circles. Fail closed: no shares until HouseRules is 0.2 or newer. */ static String olderHouseRules(String version) { if (version == null) return null; @@ -197,7 +197,7 @@ static String olderHouseRules(String version) { } catch (NumberFormatException e) { // Unreadable version: treat it as too old. } - return "Coordinate sharing is off because HouseRules " + version + " can't see BlueMinimap's shares, so they'd skip its chat circles. Update HouseRules to 0.2.0 or newer."; + return "Coordinate sharing is off because HouseRules " + version + " can't see BlueMapMini's shares, so they'd skip its chat circles. Update HouseRules to 0.2.0 or newer."; } private String olderHouseRules() { diff --git a/src/main/java/com/extantape/blueminimap/theme/ThemeSet.java b/src/main/java/com/extantape/blueminimap/theme/ThemeSet.java index 974da68..708fa81 100644 --- a/src/main/java/com/extantape/blueminimap/theme/ThemeSet.java +++ b/src/main/java/com/extantape/blueminimap/theme/ThemeSet.java @@ -21,7 +21,7 @@ /** * The themes the pack is built with: the built-in ones from the jar's {@code themes/} folder, plus or - * replaced by any in the server's {@code plugins/BlueMinimap/themes/}. The pack holds every theme, so a + * replaced by any in the server's {@code plugins/BlueMapMini/themes/}. The pack holds every theme, so a * player can switch with {@code /hud theme} without a new download. */ public final class ThemeSet { diff --git a/src/main/java/com/extantape/blueminimap/tiles/GridCache.java b/src/main/java/com/extantape/blueminimap/tiles/GridCache.java index 0816fa5..0460fd5 100644 --- a/src/main/java/com/extantape/blueminimap/tiles/GridCache.java +++ b/src/main/java/com/extantape/blueminimap/tiles/GridCache.java @@ -51,7 +51,7 @@ public int cell(int localX, int localZ) { private final Logger logger; private final Set loading = ConcurrentHashMap.newKeySet(); private final ExecutorService loaders = Executors.newFixedThreadPool(2, runnable -> { - Thread thread = new Thread(runnable, "BlueMinimap-tiles"); + Thread thread = new Thread(runnable, "BlueMapMini-tiles"); thread.setDaemon(true); thread.setPriority(Thread.NORM_PRIORITY - 1); return thread; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f912a25..b807b78 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,4 +1,4 @@ -# BlueMinimap configuration. Apply changes with /blueminimap reload. +# BlueMapMini configuration. Apply changes with /bluemapmini reload. tiles: # file: read BlueMap's folder directly (fastest, file storage only). @@ -36,7 +36,7 @@ hud: # Players can switch with /hud mode, and their choice is saved. default-mode: map # Colours, plate and clock style for new players: classic, galaxy, desert or high-contrast, or a theme - # of your own in plugins/BlueMinimap/themes/. Players can choose their own with /hud theme. + # of your own in plugins/BlueMapMini/themes/. Players can choose their own with /hud theme. theme: classic clock: # A small clock and the in-game time after the coordinates, in 24-hour time. It's hidden where time @@ -57,8 +57,8 @@ hud: quick-hide-gesture: false commands: - # The first name no other plugin owns is used. /blueminimap map, /blueminimap hud, - # /blueminimap:map and /blueminimap:hud always work. + # The first name no other plugin owns is used. /bluemapmini map, /bluemapmini hud, + # /bluemapmini:map and /bluemapmini:hud always work. map-names: [map, worldmap] hud-names: [hud, minimap] @@ -96,13 +96,13 @@ markers: show-death: true pack: - # false means your own merged pack provides the files. See /blueminimap pack export. + # false means your own merged pack provides the files. See /bluemapmini pack export. send: true # true kicks players who decline the pack, with kick-message. A download that fails never kicks: # the player plays without the map, admins are warned, and it tries again on a world change or rejoin. required: true - kick-message: "This server needs the BlueMinimap resource pack." - prompt: "BlueMinimap draws the map with this small resource pack." + kick-message: "This server needs the BlueMapMini resource pack." + prompt: "BlueMapMini draws the map with this small resource pack." port: 8164 # Address the pack server listens on. Empty listens on every address, as before. 127.0.0.1 keeps it on # this machine only: then only players on this machine can download from it, so use pack.public-url (or @@ -113,9 +113,9 @@ pack: host: "" # Host the pack elsewhere, such as a CDN or GitHub release. Overrides the port. # {sha1} is replaced with the built pack's hash, so the address changes when the pack does. - # Upload plugins/BlueMinimap/pack/blueminimap-pack.zip unchanged; re-zipping it changes the hash. + # Upload plugins/BlueMapMini/pack/bluemapmini-pack.zip unchanged; re-zipping it changes the hash. public-url: "" - # On startup and /blueminimap reload, download public-url once and warn if it isn't the current pack. + # On startup and /bluemapmini reload, download public-url once and warn if it isn't the current pack. # Turn off if the server itself can't reach that address. verify-public-url: true # Make one boss bar colour transparent. Turn off only with the action bar. @@ -131,7 +131,7 @@ share: # Who can be offered a share: world-group is players in the sender's world, counting its _nether and # _the_end as the same world. all-online is everyone, for servers whose rules plugin narrows each share # through CoordinateShareEvent; with no such plugin listening it acts like world-group. Players who - # turned shares off (/hud hide shares) or lack blueminimap.share.receive are never offered. + # turned shares off (/hud hide shares) or lack bluemapmini.share.receive are never offered. candidates: world-group # Seconds a player waits between shares, so it can't be used to spam. cooldown-seconds: 30 diff --git a/src/main/resources/paper-plugin.yml b/src/main/resources/paper-plugin.yml index 717493e..165d7c3 100644 --- a/src/main/resources/paper-plugin.yml +++ b/src/main/resources/paper-plugin.yml @@ -1,9 +1,12 @@ -name: BlueMinimap +name: BlueMapMini version: '${version}' -main: com.extantape.blueminimap.BlueMinimapPlugin +main: com.extantape.blueminimap.BlueMapMiniPlugin +# Answers to its old name too, for 0.3.x, so other plugins that look for BlueMinimap (HouseRules) still find it. +provides: + - BlueMinimap api-version: '26.1' description: A BlueMap minimap and coordinates HUD, with a fullscreen map, drawn with a resource pack font. -website: https://github.com/ExtantApe/BlueMinimap +website: https://github.com/ExtantApe/BlueMapMini # Commands are registered with Brigadier in code, so there is no commands section. dependencies: server: @@ -18,39 +21,57 @@ dependencies: required: false join-classpath: true permissions: - blueminimap.use: + bluemapmini.use: description: See and control the minimap. default: true - blueminimap.fullscreen: + bluemapmini.fullscreen: description: Open the fullscreen map. default: true - blueminimap.seeplayers: + bluemapmini.seeplayers: description: See other players on the map. default: true - blueminimap.share.send: + bluemapmini.share.send: description: Share your coordinates with /hud share. default: true - blueminimap.share.receive: + bluemapmini.share.receive: description: Receive coordinates other players share. default: true + bluemapmini.admin: + description: Use /bluemapmini reload, debug and pack commands. + default: op + blueminimap.use: + description: The name for bluemapmini.use in 0.2.x, before the rename to BlueMapMini (D194). Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. + default: true + blueminimap.fullscreen: + description: The name for bluemapmini.fullscreen in 0.2.x, before the rename to BlueMapMini (D194). Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. + default: true + blueminimap.seeplayers: + description: The name for bluemapmini.seeplayers in 0.2.x, before the rename to BlueMapMini (D194). Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. + default: true + blueminimap.share.send: + description: The name for bluemapmini.share.send in 0.2.x, before the rename to BlueMapMini (D194). Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. + default: true + blueminimap.share.receive: + description: The name for bluemapmini.share.receive in 0.2.x, before the rename to BlueMapMini (D194). Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. + default: true blueminimap.admin: - description: Use /blueminimap reload, debug and pack commands. + description: The name for bluemapmini.admin in 0.2.x, before the rename to BlueMapMini (D194). Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: op bluemaphud.use: - description: The old name for blueminimap.use, from before the rename. Still respected in 0.2.x (a "no" on either name wins for nodes that are on by default) and removed in the next release. + description: The 0.1.x name for bluemapmini.use, from before the rename. Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: true bluemaphud.fullscreen: - description: The old name for blueminimap.fullscreen, from before the rename. Still respected in 0.2.x (a "no" on either name wins for nodes that are on by default) and removed in the next release. + description: The 0.1.x name for bluemapmini.fullscreen, from before the rename. Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: true bluemaphud.seeplayers: - description: The old name for blueminimap.seeplayers, from before the rename. Still respected in 0.2.x (a "no" on either name wins for nodes that are on by default) and removed in the next release. + description: The 0.1.x name for bluemapmini.seeplayers, from before the rename. Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: true bluemaphud.share.send: - description: The old name for blueminimap.share.send, from before the rename. Still respected in 0.2.x (a "no" on either name wins for nodes that are on by default) and removed in the next release. + description: The 0.1.x name for bluemapmini.share.send, from before the rename. Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: true bluemaphud.share.receive: - description: The old name for blueminimap.share.receive, from before the rename. Still respected in 0.2.x (a "no" on either name wins for nodes that are on by default) and removed in the next release. + description: The 0.1.x name for bluemapmini.share.receive, from before the rename. Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: true bluemaphud.admin: - description: The old name for blueminimap.admin, from before the rename. Still respected in 0.2.x (a "no" on either name wins for nodes that are on by default) and removed in the next release. + description: The 0.1.x name for bluemapmini.admin, from before the rename. Still respected in 0.3.x (a "no" on any name wins for nodes that are on by default) and removed in the next release. default: op diff --git a/src/test/java/com/extantape/blueminimap/MigrationTest.java b/src/test/java/com/extantape/blueminimap/MigrationTest.java index 4d8c63e..5271664 100644 --- a/src/test/java/com/extantape/blueminimap/MigrationTest.java +++ b/src/test/java/com/extantape/blueminimap/MigrationTest.java @@ -18,42 +18,42 @@ void copiesTheOldFolderWhenTheNewOneIsMissing(@TempDir Path plugins) throws Exce Files.writeString(old.resolve("changes.log"), "{\"a\":1}\n"); Files.writeString(old.resolve("sub/x.json"), "[]"); - String msg = Migration.copyIfMissing(old, plugins.resolve("BlueMinimap")); + String msg = Migration.copyIfMissing(old, plugins.resolve("BlueMapMini")); assertNotNull(msg); - assertEquals("profiles: {}\n", Files.readString(plugins.resolve("BlueMinimap/config.yml"))); - assertEquals("{\"a\":1}\n", Files.readString(plugins.resolve("BlueMinimap/changes.log"))); - assertEquals("[]", Files.readString(plugins.resolve("BlueMinimap/sub/x.json"))); + assertEquals("profiles: {}\n", Files.readString(plugins.resolve("BlueMapMini/config.yml"))); + assertEquals("{\"a\":1}\n", Files.readString(plugins.resolve("BlueMapMini/changes.log"))); + assertEquals("[]", Files.readString(plugins.resolve("BlueMapMini/sub/x.json"))); assertTrue(Files.exists(old.resolve("config.yml")), "the old folder is left as a backup"); - assertFalse(Files.exists(plugins.resolve("BlueMinimap.migrating"))); + assertFalse(Files.exists(plugins.resolve("BlueMapMini.migrating"))); } @Test void neverOverwritesAnExistingNewFolder(@TempDir Path plugins) throws Exception { Files.createDirectories(plugins.resolve("BlueMapHUD")); Files.writeString(plugins.resolve("BlueMapHUD/config.yml"), "old"); - Files.createDirectories(plugins.resolve("BlueMinimap")); - Files.writeString(plugins.resolve("BlueMinimap/config.yml"), "new"); + Files.createDirectories(plugins.resolve("BlueMapMini")); + Files.writeString(plugins.resolve("BlueMapMini/config.yml"), "new"); - assertNull(Migration.copyIfMissing(plugins.resolve("BlueMapHUD"), plugins.resolve("BlueMinimap"))); - assertEquals("new", Files.readString(plugins.resolve("BlueMinimap/config.yml"))); + assertNull(Migration.copyIfMissing(plugins.resolve("BlueMapHUD"), plugins.resolve("BlueMapMini"))); + assertEquals("new", Files.readString(plugins.resolve("BlueMapMini/config.yml"))); } @Test void doesNothingOnAFreshServer(@TempDir Path plugins) { - assertNull(Migration.copyIfMissing(plugins.resolve("BlueMapHUD"), plugins.resolve("BlueMinimap"))); - assertFalse(Files.exists(plugins.resolve("BlueMinimap"))); + assertNull(Migration.copyIfMissing(plugins.resolve("BlueMapHUD"), plugins.resolve("BlueMapMini"))); + assertFalse(Files.exists(plugins.resolve("BlueMapMini"))); } @Test void clearsAHalfFinishedCopyFromACrash(@TempDir Path plugins) throws Exception { Files.createDirectories(plugins.resolve("BlueMapHUD")); Files.writeString(plugins.resolve("BlueMapHUD/config.yml"), "real"); - Files.createDirectories(plugins.resolve("BlueMinimap.migrating")); - Files.writeString(plugins.resolve("BlueMinimap.migrating/junk"), "half"); + Files.createDirectories(plugins.resolve("BlueMapMini.migrating")); + Files.writeString(plugins.resolve("BlueMapMini.migrating/junk"), "half"); - assertNotNull(Migration.copyIfMissing(plugins.resolve("BlueMapHUD"), plugins.resolve("BlueMinimap"))); - assertEquals("real", Files.readString(plugins.resolve("BlueMinimap/config.yml"))); - assertFalse(Files.exists(plugins.resolve("BlueMinimap/junk"))); + assertNotNull(Migration.copyIfMissing(plugins.resolve("BlueMapHUD"), plugins.resolve("BlueMapMini"))); + assertEquals("real", Files.readString(plugins.resolve("BlueMapMini/config.yml"))); + assertFalse(Files.exists(plugins.resolve("BlueMapMini/junk"))); } } diff --git a/src/test/java/com/extantape/blueminimap/PermsTest.java b/src/test/java/com/extantape/blueminimap/PermsTest.java index 54fc513..93c41a6 100644 --- a/src/test/java/com/extantape/blueminimap/PermsTest.java +++ b/src/test/java/com/extantape/blueminimap/PermsTest.java @@ -29,40 +29,59 @@ void anOldDenyOnADefaultOnNodeStillDenies() { List log = new ArrayList<>(); Perms.logTo(log::add); // A children's group had bluemaphud.share.send set to false; the new node is still at its default, true. - Permissible kid = with(Map.of("blueminimap.share.send", true, "bluemaphud.share.send", false)); - assertFalse(Perms.has(kid, "blueminimap.share.send")); + Permissible kid = with(Map.of("bluemapmini.share.send", true, "blueminimap.share.send", true, "bluemaphud.share.send", false)); + assertFalse(Perms.has(kid, "bluemapmini.share.send")); assertEquals(1, log.size()); - assertTrue(log.get(0).contains("set blueminimap.share.send"), log.get(0)); + assertTrue(log.get(0).contains("set bluemapmini.share.send"), log.get(0)); } @Test void aNewDenyOnADefaultOnNodeDenies() { - Permissible p = with(Map.of("blueminimap.share.receive", false, "bluemaphud.share.receive", true)); - assertFalse(Perms.has(p, "blueminimap.share.receive")); + Permissible p = with(Map.of("bluemapmini.share.receive", false, "blueminimap.share.receive", true, "bluemaphud.share.receive", true)); + assertFalse(Perms.has(p, "bluemapmini.share.receive")); } @Test void untouchedDefaultsAgree() { - Permissible p = with(Map.of("blueminimap.use", true, "bluemaphud.use", true)); - assertTrue(Perms.has(p, "blueminimap.use")); - assertFalse(Perms.has(with(Map.of()), "blueminimap.admin")); + Permissible p = with(Map.of("bluemapmini.use", true, "blueminimap.use", true, "bluemaphud.use", true)); + assertTrue(Perms.has(p, "bluemapmini.use")); + assertFalse(Perms.has(with(Map.of()), "bluemapmini.admin")); + } + + @Test + void aBlueMinimapDenyOnAChildrensGroupStillDeniesAfterTheRename() { + // D194: a children's group set blueminimap.share.receive to false in 0.2.x. After the rename it must stay off. + // (share.receive, so the warn-once log doesn't overlap the test above.) + List log = new ArrayList<>(); + Perms.logTo(log::add); + Permissible kid = with(Map.of("bluemapmini.share.receive", true, "blueminimap.share.receive", false, "bluemaphud.share.receive", true)); + assertFalse(Perms.has(kid, "bluemapmini.share.receive")); + assertTrue(log.getFirst().contains("blueminimap.share.receive false"), log.getFirst()); + } + + @Test + void aBlueMinimapAdminGrantStillGrants() { + assertTrue(Perms.has(with(Map.of("blueminimap.admin", true)), "bluemapmini.admin")); } @Test void anOldAdminGrantStillGrants() { Permissible mod = with(Map.of("bluemaphud.admin", true)); - assertTrue(Perms.has(mod, "blueminimap.admin")); + assertTrue(Perms.has(mod, "bluemapmini.admin")); } @Test void everyDeclaredNodeHasAnOldTwinWithTheSameDefault() throws Exception { String yml = new String(PermsTest.class.getResourceAsStream("/paper-plugin.yml").readAllBytes()); for (String node : List.of("use", "fullscreen", "seeplayers", "share.send", "share.receive", "admin")) { - int now = yml.indexOf(" blueminimap." + node + ":\n"), old = yml.indexOf(" bluemaphud." + node + ":\n"); - assertTrue(now >= 0 && old >= 0, node); + int now = yml.indexOf(" bluemapmini." + node + ":\n"); + assertTrue(now >= 0, node); String d1 = yml.substring(yml.indexOf("default:", now)).split("\n")[0]; - String d2 = yml.substring(yml.indexOf("default:", old)).split("\n")[0]; - assertEquals(d1, d2, node); + for (String prefix : List.of("blueminimap.", "bluemaphud.")) { + int old = yml.indexOf(" " + prefix + node + ":\n"); + assertTrue(old >= 0, prefix + node); + assertEquals(d1, yml.substring(yml.indexOf("default:", old)).split("\n")[0], prefix + node); + } } } @@ -71,8 +90,8 @@ void aNewDenyWithTheOldNodeAtItsDefaultLogsNothing() { List log = new ArrayList<>(); Perms.logTo(log::add); // The admin set the new name to false; the old one is still at its default, true. Nothing to tell them. - Permissible p = with(Map.of("blueminimap.seeplayers", false, "bluemaphud.seeplayers", true)); - assertFalse(Perms.has(p, "blueminimap.seeplayers")); + Permissible p = with(Map.of("bluemapmini.seeplayers", false, "bluemaphud.seeplayers", true)); + assertFalse(Perms.has(p, "bluemapmini.seeplayers")); assertTrue(log.isEmpty(), String.valueOf(log)); } @@ -80,8 +99,8 @@ void aNewDenyWithTheOldNodeAtItsDefaultLogsNothing() { void aNewAdminGrantWithTheOldNodeAtItsDefaultLogsNothing() { List log = new ArrayList<>(); Perms.logTo(log::add); - Permissible p = with(Map.of("blueminimap.admin", true, "bluemaphud.admin", false)); - assertTrue(Perms.has(p, "blueminimap.admin")); + Permissible p = with(Map.of("bluemapmini.admin", true, "bluemaphud.admin", false)); + assertTrue(Perms.has(p, "bluemapmini.admin")); assertTrue(log.isEmpty(), String.valueOf(log)); } } diff --git a/src/test/java/com/extantape/blueminimap/RenderTest.java b/src/test/java/com/extantape/blueminimap/RenderTest.java index 2eb8445..7d40268 100644 --- a/src/test/java/com/extantape/blueminimap/RenderTest.java +++ b/src/test/java/com/extantape/blueminimap/RenderTest.java @@ -94,7 +94,7 @@ void packUsesItsOwnNamespaceAndNoShaders() throws IOException { for (String path : client.files.keySet()) { assertFalse(path.contains("shaders"), path); assertTrue(path.equals("pack.mcmeta") - || path.startsWith("assets/blueminimap/") + || path.startsWith("assets/bluemapmini/") || path.startsWith("assets/minecraft/textures/gui/sprites/boss_bar/pink_"), path); } JsonObject pack = JsonParser.parseString(new String(client.files.get("pack.mcmeta"), StandardCharsets.UTF_8)) @@ -189,7 +189,7 @@ void framesUseOneFontAndNoShadow() { frame.drawGrid(new int[16]); Component component = frame.finish(); assertEquals("hud", component.style().font().value()); - assertEquals("blueminimap", component.style().font().namespace()); + assertEquals("bluemapmini", component.style().font().namespace()); assertEquals(ShadowColor.none(), component.style().shadowColor()); } diff --git a/src/test/java/com/extantape/blueminimap/SimulatedClient.java b/src/test/java/com/extantape/blueminimap/SimulatedClient.java index 4ab8cae..e90806a 100644 --- a/src/test/java/com/extantape/blueminimap/SimulatedClient.java +++ b/src/test/java/com/extantape/blueminimap/SimulatedClient.java @@ -35,8 +35,8 @@ record Font(Map glyphs, Map spaces) {} for (ZipEntry entry; (entry = in.getNextEntry()) != null; ) files.put(entry.getName(), in.readAllBytes()); } for (String path : files.keySet()) { - if (path.startsWith("assets/blueminimap/font/") && path.endsWith(".json")) { - String name = path.substring("assets/blueminimap/font/".length(), path.length() - 5); + if (path.startsWith("assets/bluemapmini/font/") && path.endsWith(".json")) { + String name = path.substring("assets/bluemapmini/font/".length(), path.length() - 5); fonts.put(name, loadFont(new String(files.get(path), StandardCharsets.UTF_8))); } } @@ -58,7 +58,7 @@ private Font loadFont(String json) throws IOException { int height = provider.get("height").getAsInt(); int ascent = provider.get("ascent").getAsInt(); if (ascent > height) throw new AssertionError("Client rejects ascent " + ascent + " > height " + height); - String file = "assets/blueminimap/textures/" + provider.get("file").getAsString().substring("blueminimap:".length()); + String file = "assets/bluemapmini/textures/" + provider.get("file").getAsString().substring("bluemapmini:".length()); byte[] png = files.get(file); if (png == null) throw new AssertionError("Missing texture " + file); BufferedImage sheet = sheets.computeIfAbsent(file, f -> { diff --git a/test/live/README.md b/test/live/README.md index 9c6f4fa..65782ba 100644 --- a/test/live/README.md +++ b/test/live/README.md @@ -1,6 +1,6 @@ # Live tests -These run BlueMinimap on a real Paper server with real BlueMap tiles, and drive it with a protocol bot. Every frame the bot receives is decoded and compared cell by cell with BlueMap's tile files on disk. The unit tests in `src/test` cover the rendering maths; these cover everything that needs a server. +These run BlueMapMini on a real Paper server with real BlueMap tiles, and drive it with a protocol bot. Every frame the bot receives is decoded and compared cell by cell with BlueMap's tile files on disk. The unit tests in `src/test` cover the rendering maths; these cover everything that needs a server. `run.sh` builds one throwaway server on 127.0.0.1, generates a small world with a fixed seed, has BlueMap render it, runs the tests you name, and deletes the server afterwards, including when a test fails. Only one server runs at a time. @@ -48,10 +48,10 @@ BMH_ACCEPT_EULA=1 test/live/run.sh 26.1.2 suite:coordsonly,onebar | `suite` | Everything players see: map accuracy, icons, the readout, the clock, themes, sharing, hiding rules, one boss bar, updates, pack handling, reloads, icons, action bar, HTTP source, bad data. Pick groups with `suite:`, such as `suite:clock,themes,share`. | about 20 min | | `suite:clockrate` | Not part of `suite`: what the clock costs a player standing still, at steps of 1, 5 and 10 in-game minutes. | 4 min | | `load` | 20 moving bots for a minute: update size, build time and tick. Results depend on how busy the machine is. | 2 min | -| `packurl` | `public-url` with `{sha1}`, the hosted-pack check, and `/blueminimap pack export`. | 3 min | +| `packurl` | `public-url` with `{sha1}`, the hosted-pack check, and `/bluemapmini pack export`. | 3 min | | `storage` | BlueMap starting 8 times next to the plugin, and BlueMap on SQLite read through the HTTP source. | 6 min | | `backoff` | Another plugin owning `/map` and `/hud`, and getting them back once it's removed. | 2 min | -| `houserules` | The real HouseRules with BlueMinimap: shares stay inside chat circles with HouseRules 0.2, sharing turns itself off with HouseRules 0.1.1, and works without HouseRules. Needs `BMH_HOUSERULES_JAR` and `BMH_HOUSERULES_OLD_JAR`; skipped otherwise. | 3 min | +| `houserules` | The real HouseRules with BlueMapMini: shares stay inside chat circles with HouseRules 0.2, sharing turns itself off with HouseRules 0.1.1, and works without HouseRules. Needs `BMH_HOUSERULES_JAR` and `BMH_HOUSERULES_OLD_JAR`; skipped otherwise. | 3 min | Logs go to `test/live/work/server--.log`. Each test prints a summary, with any failures and skipped checks. diff --git a/test/live/backoff.js b/test/live/backoff.js index 79cb1c3..e1a8995 100644 --- a/test/live/backoff.js +++ b/test/live/backoff.js @@ -1,4 +1,4 @@ -// Command back-off: with an old-style plugin owning /map and /hud, BlueMinimap must take its next names, and +// Command back-off: with an old-style plugin owning /map and /hud, BlueMapMini must take its next names, and // get the short names back once that plugin is gone. // Usage: node backoff.js

, with and relative to the work folder. const { Server, Bot, check, section, summary, sleep, until } = require('./lib.js'); @@ -21,22 +21,22 @@ async function say(bot, command, pattern) { await s.start(); await sleep(4000); s.cmd('op Tester'); const names = s.log.match(/Commands: fullscreen map is (\S+), minimap is (\S+)\./); - check('BlueMinimap backs off to /worldmap and /minimap', names && names[1] === '/worldmap' && names[2] === '/minimap', names?.[0]); + check('BlueMapMini backs off to /worldmap and /minimap', names && names[1] === '/worldmap' && names[2] === '/minimap', names?.[0]); const bot = new Bot('Tester', port); await Promise.race([bot.spawned, sleep(20000)]); await until(() => bot.packBytes, 8000); await sleep(1000); check('/map still reaches the other plugin', await say(bot, '/map', /CONFLICT PLUGIN OWNS \/map/)); check('/hud still reaches the other plugin', await say(bot, '/hud', /CONFLICT PLUGIN OWNS \/hud/)); - check('/minimap reaches BlueMinimap', await say(bot, '/minimap off', /Minimap off/)); - check('/blueminimap hud always works', await say(bot, '/blueminimap hud on', /Minimap on/)); - check('/blueminimap:hud always works', await say(bot, '/blueminimap:hud off', /Minimap off/)); - await say(bot, '/blueminimap:hud on', /Minimap on/); + check('/minimap reaches BlueMapMini', await say(bot, '/minimap off', /Minimap off/)); + check('/bluemapmini hud always works', await say(bot, '/bluemapmini hud on', /Minimap on/)); + check('/bluemapmini:hud always works', await say(bot, '/bluemapmini:hud off', /Minimap off/)); + await say(bot, '/bluemapmini:hud on', /Minimap on/); await bot.cleanQuit(); await s.stop(); section('The other plugin is removed'); fs.rmSync(installed, { force: true }); await s.start(); await sleep(4000); const back = s.log.match(/Commands: fullscreen map is (\S+), minimap is (\S+)\./); - check('BlueMinimap takes /map and /hud again after a restart', back && back[1] === '/map' && back[2] === '/hud', back?.[0]); + check('BlueMapMini takes /map and /hud again after a restart', back && back[1] === '/map' && back[2] === '/hud', back?.[0]); await s.stop(); } catch (e) { check('Back-off test finished', false, e.stack?.slice(0, 300)); diff --git a/test/live/conflict/src/main/resources/plugin.yml b/test/live/conflict/src/main/resources/plugin.yml index 90836ca..582e1e6 100644 --- a/test/live/conflict/src/main/resources/plugin.yml +++ b/test/live/conflict/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ # Test only. Deliberately an old-style Bukkit plugin that owns /map and /hud in plugin.yml, so the live -# tests can check that BlueMinimap backs off to other names. Never install it on a real server. +# tests can check that BlueMapMini backs off to other names. Never install it on a real server. name: LiveTestConflict version: '1' main: com.extantape.blueminimap.livetest.Conflict diff --git a/test/live/fontcheck/FontCheck.java b/test/live/fontcheck/FontCheck.java index 7e47282..350e3a4 100644 --- a/test/live/fontcheck/FontCheck.java +++ b/test/live/fontcheck/FontCheck.java @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception { StringBuilder out = new StringBuilder("{"); boolean firstFont = true; for (String path : new TreeSet<>(files.keySet())) { - if (!path.startsWith("assets/blueminimap/font/")) continue; + if (!path.startsWith("assets/bluemapmini/font/")) continue; String name = path.substring(path.lastIndexOf('/') + 1, path.length() - 5); JsonArray providers = JsonParser.parseString(new String(files.get(path), StandardCharsets.UTF_8)).getAsJsonObject().getAsJsonArray("providers"); int glyphs = 0; diff --git a/test/live/helper/src/main/java/com/extantape/blueminimap/livetest/Helper.java b/test/live/helper/src/main/java/com/extantape/blueminimap/livetest/Helper.java index 8d6e2a3..c7b18b5 100644 --- a/test/live/helper/src/main/java/com/extantape/blueminimap/livetest/Helper.java +++ b/test/live/helper/src/main/java/com/extantape/blueminimap/livetest/Helper.java @@ -51,7 +51,7 @@ public void execute(CommandSourceStack source, String[] args) { @Override public String permission() { - return "blueminimap.livetest"; + return "bluemapmini.livetest"; } })); } diff --git a/test/live/helper/src/main/resources/paper-plugin.yml b/test/live/helper/src/main/resources/paper-plugin.yml index 382c2f8..4f5c291 100644 --- a/test/live/helper/src/main/resources/paper-plugin.yml +++ b/test/live/helper/src/main/resources/paper-plugin.yml @@ -10,7 +10,7 @@ dependencies: required: true join-classpath: true # For the share tests: listens to CoordinateShareEvent the way a server's chat rules plugin would. - BlueMinimap: + BlueMapMini: load: BEFORE required: true join-classpath: true diff --git a/test/live/houserules.js b/test/live/houserules.js index ef226a1..ca7b06e 100644 --- a/test/live/houserules.js +++ b/test/live/houserules.js @@ -1,4 +1,4 @@ -// BlueMinimap with the real HouseRules: shares follow chat circles, and with a HouseRules too old to see BlueMinimap's +// BlueMapMini with the real HouseRules: shares follow chat circles, and with a HouseRules too old to see BlueMapMini's // share event, sharing is off rather than unfiltered. // Usage: node houserules.js , and relative to the work folder. const { Server, Bot, check, section, summary, sleep, until } = require('./lib.js'); @@ -32,12 +32,12 @@ async function joinAll(names) { (async () => { let bots = {}; try { - section('BlueMinimap with HouseRules 0.2: shares follow the circles'); + section('BlueMapMini with HouseRules 0.2: shares follow the circles'); fs.copyFileSync(newJar, installed); fs.mkdirSync(s.path('plugins', 'HouseRules'), { recursive: true }); fs.writeFileSync(s.path('plugins', 'HouseRules', 'config.yml'), CONFIG); await s.start(); await sleep(4000); - check('HouseRules found BlueMinimap\'s share event', /BlueMinimap found: coordinate shares follow the same rules as chat/.test(s.log)); + check('HouseRules found BlueMapMini\'s share event', /BlueMapMini found: coordinate shares follow the same rules as chat/.test(s.log)); bots = await joinAll(['Tester', 'Alex', 'Blair', 'Casey']); for (const [who, circle] of [['Tester', 'red'], ['Alex', 'red'], ['Blair', 'blue']]) s.cmd(`bmt perm ${who} houserules.circle.${circle} true`); await sleep(800); @@ -53,7 +53,7 @@ async function joinAll(names) { for (const b of Object.values(bots)) await b.cleanQuit(); await s.stop(); - section('BlueMinimap with HouseRules 0.1.1: sharing is off, not unfiltered'); + section('BlueMapMini with HouseRules 0.1.1: sharing is off, not unfiltered'); fs.copyFileSync(oldJar, installed); await s.start(); await sleep(4000); bots = await joinAll(['Tester', 'Alex', 'Blair']); @@ -64,11 +64,11 @@ async function joinAll(names) { await sleep(600); check('The sender is told sharing is off', /Sharing coordinates is off on this server for now/.test(off || ''), off); check('and nobody receives anything', !heard(bots.Alex, marks.Alex) && !heard(bots.Blair, marks.Blair)); - check('The log tells the admin to update HouseRules', /HouseRules 0\.1\.1 can't see BlueMinimap's shares.*Update HouseRules to 0\.2\.0/.test(s.since(mark))); + check('The log tells the admin to update HouseRules', /HouseRules 0\.1\.1 can't see BlueMapMini's shares.*Update HouseRules to 0\.2\.0/.test(s.since(mark))); for (const b of Object.values(bots)) await b.cleanQuit(); await s.stop(); - section('BlueMinimap without HouseRules: sharing works'); + section('BlueMapMini without HouseRules: sharing works'); fs.rmSync(installed, { force: true }); await s.start(); await sleep(4000); bots = await joinAll(['Tester', 'Alex']); diff --git a/test/live/lib.js b/test/live/lib.js index 476d0fd..ebe841e 100644 --- a/test/live/lib.js +++ b/test/live/lib.js @@ -1,4 +1,4 @@ -// Live test kit for BlueMinimap: server control, a protocol bot, a frame decoder, and an independent +// Live test kit for BlueMapMini: server control, a protocol bot, a frame decoder, and an independent // reading of BlueMap's tiles to compare frames against. See README.md in this folder. const path = require('path'), fs = require('fs'), zlib = require('zlib'), cp = require('child_process'), crypto = require('crypto'); /** Holds the server jars, plugins and throwaway servers. Never committed. */ @@ -81,10 +81,10 @@ class Server { await sleep(500); } errors(from = 0) { - return this.log.slice(from).split('\n').filter((l) => /\bERROR\b|Exception|\bat com\.extantape|BlueMinimap.*WARN|WARN.*BlueMinimap/.test(l) && !/Advanced terminal/.test(l)); + return this.log.slice(from).split('\n').filter((l) => /\bERROR\b|Exception|\bat com\.extantape|BlueMapMini.*WARN|WARN.*BlueMapMini/.test(l) && !/Advanced terminal/.test(l)); } path(...p) { return path.join(this.dir, ...p); } - setConfig(edits) { editYaml(this.path('plugins/BlueMinimap/config.yml'), edits); } + setConfig(edits) { editYaml(this.path('plugins/BlueMapMini/config.yml'), edits); } } /** Sets scalar values by dotted path, keeping everything else in the file. */ @@ -155,7 +155,7 @@ class Pack { for (const p of font.providers) { if (p.type === 'space') { for (const [k, v] of Object.entries(p.advances)) map.set(k.codePointAt(0), { kind: 'space', advance: v }); continue; } if (p.ascent > p.height) throw new Error(`ascent ${p.ascent} > height ${p.height}`); - const file = 'assets/blueminimap/textures/' + p.file.split(':')[1]; + const file = 'assets/bluemapmini/textures/' + p.file.split(':')[1]; const sheet = sheets[file] || (sheets[file] = readPng(this.files[file])); const rows = p.chars.map((s) => [...s]), cols = rows[0].length; const cw = sheet.w / cols, ch = sheet.h / rows.length, scale = p.height / ch; @@ -312,7 +312,7 @@ class Bot { if (this.downloadStatus === 200) { const res = await fetch(p.url), buf = Buffer.from(await res.arrayBuffer()); this.packSha = crypto.createHash('sha1').update(buf).digest('hex'); - if (p.url.includes('blueminimap')) { this.packUrl = p.url; this.packBytes = buf; } + if (p.url.includes('bluemapmini')) { this.packUrl = p.url; this.packBytes = buf; } } const send = (result) => this.bot._client.write('resource_pack_receive', { uuid: p.uuid, result }); if (this.mode === 'ignore') return; diff --git a/test/live/package.json b/test/live/package.json index 498204a..5645301 100644 --- a/test/live/package.json +++ b/test/live/package.json @@ -1,7 +1,7 @@ { - "name": "blueminimap-live-tests", + "name": "bluemapmini-live-tests", "private": true, - "description": "Live tests for BlueMinimap: throwaway Paper servers driven by a protocol bot.", + "description": "Live tests for BlueMapMini: throwaway Paper servers driven by a protocol bot.", "license": "MIT", "type": "commonjs", "engines": { diff --git a/test/live/packurl.js b/test/live/packurl.js index 38b8973..1887013 100644 --- a/test/live/packurl.js +++ b/test/live/packurl.js @@ -1,4 +1,4 @@ -// Live test for pack.public-url with {sha1}, the hosted-pack check, and /blueminimap pack export. +// Live test for pack.public-url with {sha1}, the hosted-pack check, and /bluemapmini pack export. // Usage: node packurl.js