Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BlueMapMini: a BlueMap minimap and coordinates HUD for Paper, rendered in game f

It's an unofficial add-on for BlueMap and isn't affiliated with BlueMap's authors.

**Status:** pre-release, version 0.4.1. 0.3.0 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. 0.4.1 (the share audience setting) passed it again on 26.3 only, 334 of 335 with the client font check skipped, plus the real Mayor test. It hasn't been seen in a real game client yet. See [Testing](#testing).
**Status:** pre-release, version 0.5.0, for Posse 0.11.0. 0.5.0 passed the full live suite and the real-Posse test (8 checks) on throwaway Paper 26.3 (337 checks, the client font check skipped), 2026-11-25, and on 26.1.2 and 26.2 (337 each) just before the old share keys were dropped; the config change is covered by unit tests there. 0.3.0 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. 0.4.1 (the share audience setting) passed it again on 26.3 only, 334 of 335 with the client font check skipped, plus the real Posse test. 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.
Expand Down Expand Up @@ -92,17 +92,17 @@ 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:** set by `share.audience`, which is `off` by default, so nothing can be shared until an admin picks one:
- `mayor`: whoever Mayor's player groups allow, the same as chat. Needs Mayor 0.5.0 or newer. Without it, sharing stays off and the console says why.
- `mayor-world-group`: players in the same world group whom Mayor's groups also allow. Needs Mayor 0.5.0 or newer.
- `posse`: whoever Posse's player groups allow, the same as chat. Needs Posse 0.11.0 or newer. Without it, sharing stays off and the console says why.
- `posse-world-group`: players in the same world group whom Posse's groups also allow. Needs Posse 0.11.0 or newer.
- `world`: players in the same world.
- `world-group`: players in the same world, counting its `_nether` and `_the_end` as the same world.
- `server`: anyone online.

In every mode a receiver must be able to see the sender, have `bluemapmini.share.receive`, and not have turned shares off with `/hud hide shares`. An unknown value counts as `off`. A Mayor older than 0.5.0 turns sharing off in every mode. A config from before 0.4.0 gets the narrowest mode matching its old `enabled`, `candidates` and `require-mayor` keys, so an upgrade never widens sharing: the old defaults become `mayor-world-group`.
In every mode a receiver must be able to see the sender, have `bluemapmini.share.receive`, and not have turned shares off with `/hud hide shares`. An unknown value counts as `off`. A Posse older than 0.11.0 turns sharing off in every mode. A config with no `share.audience` is `off`; the older `enabled`, `candidates` and `require-*` keys aren't read.
- **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.

**Your server's own rules.** BlueMapMini fires `com.extantape.bluemapmini.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. In the `mayor` and `server` modes, recipients start as everyone online, so such a plugin can follow rules that reach across worlds. To build against it, depend on BlueMapMini as a server dependency with `join-classpath: true` in your `paper-plugin.yml`.
**Your server's own rules.** BlueMapMini fires `com.extantape.bluemapmini.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. In the `posse` and `server` modes, recipients start as everyone online, so such a plugin can follow rules that reach across worlds. To build against it, depend on BlueMapMini as a server dependency with `join-classpath: true` in your `paper-plugin.yml`.

## Resource packs

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = "com.extantape"
version = "0.4.1"
version = "0.5.0"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
Expand Down
1 change: 1 addition & 0 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Owner decisions for BlueMapHUD, newest first.

| Date | Decision | Why |
| --- | --- | --- |
| 2026-11-25 | Mayor is now Posse (D196, D292). `share.audience` takes `posse` and `posse-world-group`. The old values `mayor` and `mayor-world-group` are unknown and turn sharing off, and no old key is read, including the pre-0.4.0 `share.enabled`, `share.candidates` and `share.require-mayor`: a config with no `share.audience` is off. | The owner: "Get rid of mayor yes" and D295. An unknown or missing value fails closed. |
| 2026-11-21 | `share.audience` sets who coordinates can go to: off (the default), Mayor's groups, Mayor's groups within the world group, the same world, the world group, or the whole server. Mayor's modes fail closed without Mayor, and old configs migrate to the narrowest matching mode (D254). | The owner: "Should have configurability for all scenarios, including full server, etc". |
| 2026-11-07 | A failed pack download never kicks. The player stays with the map off and a clear message, admins are warned (at most every five minutes), and the pack is offered again on their next world change or rejoin. Only a deliberate decline follows `pack.required`. | Never kick a player over a hosting problem: it isn't their fault, and kicking them can't fix it. |
| 2026-11-07 | `/hud share` reaches the same people as chat. A cancellable `CoordinateShareEvent` with a mutable recipient set lets the server's rules plugin filter shares. Without one, shares need the send and receive permissions, stay in the sender's world group, and players can opt out. `share.candidates: all-online` only widens shares while a plugin listens to the event. | Children on the server should only reach the people they can already chat with. Keeping the rules in one plugin means BlueMapHUD doesn't hard-code any server's groups. |
Expand Down
16 changes: 16 additions & 0 deletions docs/releases/v0.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Works with Posse 0.11.0 (formerly Mayor); the Mayor name is no longer recognized (D196, D292).

## What changed

- **`share.audience` values `mayor` and `mayor-world-group` are now `posse` and `posse-world-group`.** The old values are unknown, and an unknown value turns sharing off with a console warning. A server that has `mayor` set shares nothing until its config is edited. Nothing widens.
- **Posse 0.11.0 or newer is required for the two Posse modes.** With no Posse, or an older one, sharing is off in those modes and the console says why. The older-version check now refuses any Posse before 0.11.0, which cannot exist, so in practice it means "install Posse".
- **No old key is read.** A config with no `share.audience` is off, and the pre-0.4.0 keys (`share.enabled`, `share.candidates` and `share.require-mayor`) are ignored, so an old file can't switch sharing on. Posse is also now an optional load-before dependency in `paper-plugin.yml`.
- The shipped `config.yml`, the README, the console messages and the live test (`posse.js`, run with `BMM_POSSE_JAR`) use the new name.

## Upgrading from 0.4.1

A config that still has only the old keys has sharing off. Before the first start, change `share.audience: mayor` to `posse` and `mayor-world-group` to `posse-world-group` in `plugins/BlueMapMini/config.yml`. Install Posse 0.11.0 in the same stop. Nothing else changes.

## Tested

Unit tests, including the old values being unknown. Live bot suite (the client font check skipped, no client classpath) and the real-Posse test (8 checks, Posse 0.11.0 from its release) on throwaway Paper servers: 337/337 on 26.3 with the final code, and 337/337 on 26.1.2 and 26.2 just before the old share keys were dropped (unit tests cover that change). Not yet seen in a real game client.
11 changes: 11 additions & 0 deletions docs/test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

Kept by this repo's owning session (Minecraft: Plugins Lead), per `~/Code/CLAUDE.md`, "Test self-audits". Newest first.

## 2026-11-25: Posse rename (0.5.0)

| Promise | Covered by |
| --- | --- |
| `posse` and `posse-world-group` read; the old `mayor` values are unknown, so sharing is off | unit `PosseGuardTest.theOldMayorNameIsNotAnAudience`; live "The old audience ... is unknown" (26.1.2 and 26.2) |
| Posse modes fail closed with no Posse or one older than 0.11.0 | unit `PosseGuardTest`; live "audience: posse with no Posse installed stays off" |
| No old key is read: only the old keys means off | unit `ShareConfigTest.olderShareKeysAloneMeanOff` |
| Shares follow Posse's circles | live `posse.js` (8 checks, real Posse 0.11.0), on 26.1.2, 26.2 and 26.3 |

Gaps skipped: 26.1.2 and 26.2 weren't rerun after the old share keys were dropped; unit tests cover that parse, and 26.3 reran with the final code.

## 2026-11-24: share.audience (0.4.1)

| Promise | Covered by |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ public void onServerLoad(ServerLoadEvent event) {
/** Says who coordinates can be shared with, and warns about a bad setting. Also run after a reload. */
private void logShareAudience() {
var share = config.share();
if (share.audienceUnknown()) getLogger().warning("share.audience isn't one of off, mayor, mayor-world-group, world, world-group or server, so sharing is off.");
if (share.audienceUnknown()) getLogger().warning("share.audience isn't one of off, posse, posse-world-group, world, world-group or server, so sharing is off.");
getLogger().info("Coordinate sharing: " + switch (share.audience()) {
case OFF -> "off.";
case MAYOR -> "to whoever Mayor's player groups allow.";
case MAYOR_WORLD_GROUP -> "to players in the same world group whom Mayor's player groups allow.";
case POSSE -> "to whoever Posse's player groups allow.";
case POSSE_WORLD_GROUP -> "to players in the same world group whom Posse's player groups allow.";
case WORLD -> "to players in the same world.";
case WORLD_GROUP -> "to players in the same world, counting its Nether and End.";
case SERVER -> "to anyone online.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* 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 bluemapmini.share.receive}, are already gone.
*
* <p>In the {@code mayor} and {@code server} modes of {@code share.audience}, the recipients start as everyone
* <p>In the {@code posse} and {@code server} modes of {@code share.audience}, the recipients start as everyone
* online, including players in other worlds.
*/
public final class CoordinateShareEvent extends Event implements Cancellable {
Expand Down
36 changes: 11 additions & 25 deletions src/main/java/com/extantape/bluemapmini/config/HudConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public enum Channel { BOSS_BAR, ACTION_BAR }
public enum ShareAudience {
/** Nobody: sharing is off. The default. */
OFF("off"),
/** Whoever Mayor's player groups allow, the same as chat. Off (fail closed) if Mayor 0.5.0+ isn't running. */
MAYOR("mayor"),
/** Players in the sender's world group whom Mayor's player groups also allow. Off without Mayor 0.5.0+. */
MAYOR_WORLD_GROUP("mayor-world-group"),
/** Whoever Posse's player groups allow, the same as chat. Off (fail closed) if Posse 0.5.0+ isn't running. */
POSSE("posse"),
/** Players in the sender's world group whom Posse's player groups also allow. Off without Posse 0.5.0+. */
POSSE_WORLD_GROUP("posse-world-group"),
/** Players in the sender's exact world. */
WORLD("world"),
/** Players in the sender's world, counting its _nether and _the_end as the same world. */
Expand All @@ -52,22 +52,11 @@ public static ShareAudience of(String key) {
return null;
}

/**
* share.audience, or for a config written before it existed, the narrowest mode matching the older keys, so an
* upgrade never widens sharing: enabled false is off; require-mayor true (their default) is mayor with
* all-online and mayor-world-group otherwise; require-mayor false is world-group, because all-online without a
* filtering plugin stayed in the world group. With none of them set, off. An unknown value is off.
*/
public static ShareAudience resolve(String audience, Boolean enabled, Boolean requireMayor, String candidates) {
if (audience != null) {
ShareAudience a = of(audience);
return a == null ? OFF : a;
}
if (enabled == null && requireMayor == null && candidates == null) return OFF;
if (Boolean.FALSE.equals(enabled)) return OFF;
boolean allOnline = "all-online".equalsIgnoreCase(candidates);
if (!Boolean.FALSE.equals(requireMayor)) return allOnline ? MAYOR : MAYOR_WORLD_GROUP;
return WORLD_GROUP;
/** share.audience. Nothing set is off, and so is an unknown value, which fails closed. */
public static ShareAudience resolve(String audience) {
if (audience == null) return OFF;
ShareAudience a = of(audience);
return a == null ? OFF : a;
}
}

Expand Down Expand Up @@ -177,13 +166,10 @@ public static HudConfig from(FileConfiguration c) {
c.getBoolean("pack.bedrock-exempt", true),
c.getBoolean("pack.re-send-on-removal", true));

// Read without the jar's defaults, so an older config with no share.audience keeps what its old keys said.
// Read without the jar's defaults, so a config with no share.audience is off. Older share keys aren't read.
String audienceKey = c.contains("share.audience", true) ? c.getString("share.audience") : null;
Share share = new Share(
ShareAudience.resolve(audienceKey,
c.contains("share.enabled", true) ? c.getBoolean("share.enabled") : null,
c.contains("share.require-mayor", true) ? c.getBoolean("share.require-mayor") : null,
c.contains("share.candidates", true) ? c.getString("share.candidates") : null),
ShareAudience.resolve(audienceKey),
audienceKey != null && ShareAudience.of(audienceKey) == null,
clamp(c.getInt("share.cooldown-seconds", 30), 0, 3600),
c.getBoolean("share.log", true));
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/com/extantape/bluemapmini/share/ShareService.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public static String worldGroup(String world) {

/**
* Whether a player in {@code otherWorld} can be offered a share from {@code senderWorld} under this audience
* (D254). Mayor's mode offers everyone and leaves narrowing to Mayor through the share event; off offers nobody.
* (D254). Posse's mode offers everyone and leaves narrowing to Posse through the share event; off offers nobody.
*/
static boolean offered(HudConfig.ShareAudience audience, String senderWorld, String otherWorld) {
return switch (audience) {
case OFF -> false;
case WORLD -> senderWorld.equals(otherWorld);
case WORLD_GROUP, MAYOR_WORLD_GROUP -> worldGroup(senderWorld).equals(worldGroup(otherWorld));
case MAYOR, SERVER -> true;
case WORLD_GROUP, POSSE_WORLD_GROUP -> worldGroup(senderWorld).equals(worldGroup(otherWorld));
case POSSE, SERVER -> true;
};
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public static Player findVisible(Player sender, String name) {
public String blocked(Player sender) {
if (config().audience() == HudConfig.ShareAudience.OFF) return "Sharing coordinates is turned off on this server.";
if (!com.extantape.bluemapmini.Perms.has(sender, SEND)) return "You can't share your coordinates here.";
String guard = olderMayor();
String guard = olderPosse();
if (guard != null) {
plugin.getLogger().warning(guard);
return "Sharing coordinates is off on this server for now. An admin has been told why.";
Expand Down Expand Up @@ -188,28 +188,28 @@ private static String place(World world) {
}

/**
* In Mayor's modes, shares follow Mayor's player groups, so they're off (fail closed) unless Mayor 0.5.0 or newer
* is running. In every mode, a Mayor older than 0.5.0 turns sharing off, because it listens for a share event
* BlueMapMini doesn't send and would let shares skip its groups. The version is null when Mayor isn't running.
* In Posse's modes, shares follow Posse's player groups, so they're off (fail closed) unless Posse 0.11.0 or newer
* is running. In every mode, a Posse older than 0.11.0 turns sharing off, because it listens for a share event
* BlueMapMini doesn't send and would let shares skip its groups. The version is null when Posse isn't running.
* Returns why sharing is off, or null.
*/
static String mayorGuard(HudConfig.ShareAudience audience, String version) {
boolean needsMayor = audience == HudConfig.ShareAudience.MAYOR || audience == HudConfig.ShareAudience.MAYOR_WORLD_GROUP;
if (version == null && !needsMayor) return null;
if (version == null) return "Coordinate sharing is off: share.audience follows Mayor's player groups, and Mayor isn't running. Install Mayor 0.5.0 or newer, or pick another share.audience.";
static String posseGuard(HudConfig.ShareAudience audience, String version) {
boolean needsPosse = audience == HudConfig.ShareAudience.POSSE || audience == HudConfig.ShareAudience.POSSE_WORLD_GROUP;
if (version == null && !needsPosse) return null;
if (version == null) return "Coordinate sharing is off: share.audience follows Posse's player groups, and Posse isn't running. Install Posse 0.11.0 or newer, or pick another share.audience.";
String[] p = version.split("[.-]");
try {
int major = Integer.parseInt(p[0]), minor = p.length > 1 ? Integer.parseInt(p[1]) : 0;
if (major > 0 || minor >= 5) return null;
if (major > 0 || minor >= 11) return null;
} catch (NumberFormatException e) {
// Unreadable version: treat it as too old.
}
return "Coordinate sharing is off because Mayor " + version + " can't see BlueMapMini's shares, so they'd skip its player groups. Update Mayor to 0.5.0 or newer.";
return "Coordinate sharing is off because Posse " + version + " can't see BlueMapMini's shares, so they'd skip its player groups. Update Posse to 0.11.0 or newer.";
}

private String olderMayor() {
org.bukkit.plugin.Plugin mayor = plugin.getServer().getPluginManager().getPlugin("Mayor");
boolean on = mayor != null && mayor.isEnabled();
return mayorGuard(config().audience(), on ? mayor.getPluginMeta().getVersion() : null);
private String olderPosse() {
org.bukkit.plugin.Plugin posse = plugin.getServer().getPluginManager().getPlugin("Posse");
boolean on = posse != null && posse.isEnabled();
return posseGuard(config().audience(), on ? posse.getPluginMeta().getVersion() : null);
}
}
Loading
Loading