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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Paper plugin that sends each world its own required resource packs, and warns

- Each world has an ordered list of packs. They're sent together with the multi-pack API, and later packs sit on top of earlier ones. A world with an empty list gets no packs from Packmule.
- Moving between worlds with the same packs sends nothing. Moving to a world with different packs swaps only Packmule's packs.
- Packmule never removes or replaces a pack it didn't send. Another plugin's pack, such as BlueMapHUD's, stays put.
- Packmule never removes or replaces a pack it didn't send. Another plugin's pack, such as BlueMinimap's, stays put.
- Every pack is required. A player who declines is kicked. A client that doesn't answer the prompt in 60 seconds is kicked.
- A failed download is sent again twice. If it still fails, the player stays in without that pack and admins are told which world and pack. Nobody is kicked over a hosting problem.
- At startup, Packmule downloads every pack and checks its SHA-1. A 404, a timeout, a wrong hash or a malformed address is reported with the worlds it affects. That pack is skipped until it's fixed, and the rest keep working. Startup doesn't wait for the check.
Expand Down Expand Up @@ -113,7 +113,7 @@ cd test && npm install
PACKMULE_TEST_WORK=/tmp/rpb PACKMULE_TEST_JARS=/path/to/jars PACKMULE_TEST_JAVA=/path/to/java25 node suite.mjs 26.3
```

`PACKMULE_TEST_JARS` holds `paper-<version>.jar` for each version, Multiverse-Core 5.8.2, Multiverse-Inventories 5.3.6, `bluemap-5.29-paper.jar`, and ViaVersion and ViaBackwards 5.12.3. BlueMapHUD and Waystation come from their own builds in `~/Code`.
`PACKMULE_TEST_JARS` holds `paper-<version>.jar` for each version, Multiverse-Core 5.8.2, Multiverse-Inventories 5.3.6, `bluemap-5.29-paper.jar`, and ViaVersion and ViaBackwards 5.12.3. BlueMinimap and Waystation come from their own builds in `~/Code`.

## What hasn't been tested

Expand All @@ -123,7 +123,7 @@ Only a real client can tell:
- Whether a player who clicks Disconnect on the prompt sees Packmule's kick message, or the game's own screen. The client may leave before the kick arrives.
- How the prompt and kick text read on screen, line breaks included.
- Whether switching feels acceptable when worlds use large packs.
- Whether packs stack in the right order next to BlueMapHUD's, and whether its font still draws.
- Whether packs stack in the right order next to BlueMinimap's, and whether its font still draws.
- What happens across a server transfer.
- How older clients connected through ViaVersion treat the pack format.

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# sit on top of earlier ones. An empty list [] means Packmule sends that world nothing.
# A world that isn't listed also gets nothing, and Packmule warns about it at startup.
#
# Packmule only ever removes packs it sent. Other plugins' packs (BlueMapHUD's, say) are left alone.
# Packmule only ever removes packs it sent. Other plugins' packs (BlueMinimap's, say) are left alone.
# Leave resource-pack= empty in server.properties: a pack there fights Packmule's.

packs: {}
Expand Down
4 changes: 2 additions & 2 deletions test/suite.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (VERSION === '26.3') process.env.PACKMULE_TEST_STILL = '1' // see Bot: 26.3 k
const LONG = process.env.PACKMULE_TEST_LONG !== '0'
const jar = n => path.join(JARS, n)
const plugins = [jar('multiverse-core-5.8.2.jar'), jar('multiverse-inventories-5.3.6.jar'), jar('bluemap-5.29-paper.jar'),
(() => { const d = path.join(process.env.HOME, 'Code/BlueMapHUD/build/libs'); const f = readdirSync(d).filter(n => /^BlueMinimap-[\d.]+\.jar$/.test(n)); if (f.length !== 1) throw new Error('expected one BlueMinimap jar in ' + d); return path.join(d, f[0]) })()]
(() => { const d = path.join(process.env.HOME, 'Code/BlueMinimap/build/libs'); const f = readdirSync(d).filter(n => /^BlueMinimap-[\d.]+\.jar$/.test(n)); if (f.length !== 1) throw new Error('expected one BlueMinimap jar in ' + d); return path.join(d, f[0]) })()]
plugins.push(jar('ViaVersion-5.12.3-SNAPSHOT.jar'), jar('ViaBackwards-5.12.3-SNAPSHOT.jar'))

const HUD_ID = (() => { // BlueMinimap's fixed pack ID (unchanged from its BlueMapHUD days): UUID.nameUUIDFromBytes("bluemaphud:pack")
Expand Down Expand Up @@ -59,7 +59,7 @@ const TEST_TIMEOUT = 'answer-timeout-seconds: 6\n'
// ---------- server ----------
const dir = freshServer(`suite-${VERSION}`, { paper: jar(`paper-${VERSION}.jar`), plugins, packmuleConfig: goodConfig(TEST_TIMEOUT) })
// BlueMinimap hosts its pack on port 8164 by default, which other sessions' test servers may hold. Give it one of ours.
{ const hud = readFileSync(path.join(process.env.HOME, 'Code/BlueMapHUD/src/main/resources/config.yml'), 'utf8')
{ const hud = readFileSync(path.join(process.env.HOME, 'Code/BlueMinimap/src/main/resources/config.yml'), 'utf8')
if (!/^ port: 8164$/m.test(hud)) throw new Error("BlueMinimap's default config no longer has port: 8164")
const { mkdirSync } = await import('node:fs'); mkdirSync(path.join(dir, 'plugins/BlueMinimap'), { recursive: true })
writeFileSync(path.join(dir, 'plugins/BlueMinimap/config.yml'), hud.replace(/^ port: 8164$/m, ' port: 25615')) }
Expand Down
Loading