Manage resource packs and the server list per pack #3

Merged
Bewerkt merged 1 commit from claude/minecraft-mod-manager-h5capw into main 2026-10-12 14:56:51 +00:00
Bewerkt commented 2026-10-12 14:51:26 +00:00 (Migrated from github.com)

What changes

Admin UI: two new tabs per pack

  • Resource packs: upload .zip resource packs (validated by their pack.mcmeta) and order them (top = applied on top). "On for players" decides whether a pack is switched on automatically.
  • Servers: name + address (host, host:port or [IPv6]:port), ordered. Validated on the server and again in the mod; control and § formatting characters are stripped from names.
  • Resource packs in Modrinth packs (and overrides/resourcepacks) are now imported too. Downloads stay limited to the official CDNs and are hash-verified.
  • Duplicating a pack copies its resource packs and servers; deleting cleans up unused files.
  • The manifest gains resourcePacks (with a stable id) and servers. Older mods ignore them.

Mod (clients only; dedicated servers ignore both)

  • Resource packs:
    • Downloaded together with the mods, in the same progress bar and ETA. Hash-verified, then moved into resourcepacks/.
    • Switched on in options.txt only the first time a player receives a pack; after that the player's choice wins, also across new versions of the same pack.
    • Removed packs are deleted again. A player's own file with the same name is moved to .managemc/replaced-resourcepacks/, never deleted.
  • Servers: managed entries stay at the top of servers.dat. The player's own servers, their order and unknown NBT data (icons etc.) are kept unchanged. A server the player already had is never taken over.
  • Restart rule: on NeoForge a changed resource pack selection closes the game once, because Minecraft has already read options.txt there. On Fabric (preLaunch) and with the pre-launch command, no restart is needed. Server list changes never need a restart.
  • New code:
    • client/: NBT reader/writer with depth and length limits, ServerListFile, ResourcePackOptions (changes only the affected lines and keeps the file's line endings), ClientExtrasSync.
    • PackFile abstraction, so jars and resource packs share the download pipeline.

Tests

  • Server: 38 tests. New: resource pack validation, serving and ordering; server address validation, duplicates and ordering; manifest content; Modrinth import with resource packs.
  • Mod: 67 tests. New:
    • NBT round trip and hardening;
    • servers.dat merge;
    • options.txt editing;
    • a full client sync covering install + enable once, the player's choice, renames, removals, a player's own file, the NeoForge restart rule, servers and dedicated-server behaviour;
    • manifest validation.
  • Manual:
    • Uploaded a resource pack and added two servers in the admin UI.
    • Synced a fresh game directory with the real server via the CLI: options.txt kept its other lines, the pack was added and enabled, and servers.dat contained both servers.
    • A second run changed nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_016zdMyacgAzBQEBSiHc6aZJ


Generated by Claude Code

## What changes **Admin UI: two new tabs per pack** - **Resource packs**: upload `.zip` resource packs (validated by their `pack.mcmeta`) and order them (top = applied on top). "On for players" decides whether a pack is switched on automatically. - **Servers**: name + address (`host`, `host:port` or `[IPv6]:port`), ordered. Validated on the server and again in the mod; control and `§` formatting characters are stripped from names. - Resource packs in Modrinth packs (and `overrides/resourcepacks`) are now imported too. Downloads stay limited to the official CDNs and are hash-verified. - Duplicating a pack copies its resource packs and servers; deleting cleans up unused files. - The manifest gains `resourcePacks` (with a stable `id`) and `servers`. Older mods ignore them. **Mod (clients only; dedicated servers ignore both)** - **Resource packs**: - Downloaded together with the mods, in the same progress bar and ETA. Hash-verified, then moved into `resourcepacks/`. - Switched on in `options.txt` only the *first* time a player receives a pack; after that the player's choice wins, also across new versions of the same pack. - Removed packs are deleted again. A player's own file with the same name is moved to `.managemc/replaced-resourcepacks/`, never deleted. - **Servers**: managed entries stay at the top of `servers.dat`. The player's own servers, their order and unknown NBT data (icons etc.) are kept unchanged. A server the player already had is never taken over. - **Restart rule**: on NeoForge a changed resource pack selection closes the game once, because Minecraft has already read `options.txt` there. On Fabric (preLaunch) and with the pre-launch command, no restart is needed. Server list changes never need a restart. - New code: - `client/`: NBT reader/writer with depth and length limits, `ServerListFile`, `ResourcePackOptions` (changes only the affected lines and keeps the file's line endings), `ClientExtrasSync`. - `PackFile` abstraction, so jars and resource packs share the download pipeline. ## Tests - Server: 38 tests. New: resource pack validation, serving and ordering; server address validation, duplicates and ordering; manifest content; Modrinth import with resource packs. - Mod: 67 tests. New: - NBT round trip and hardening; - `servers.dat` merge; - `options.txt` editing; - a full client sync covering install + enable once, the player's choice, renames, removals, a player's own file, the NeoForge restart rule, servers and dedicated-server behaviour; - manifest validation. - Manual: - Uploaded a resource pack and added two servers in the admin UI. - Synced a fresh game directory with the real server via the CLI: `options.txt` kept its other lines, the pack was added and enabled, and `servers.dat` contained both servers. - A second run changed nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016zdMyacgAzBQEBSiHc6aZJ --- _Generated by [Claude Code](https://claude.ai/code/session_016zdMyacgAzBQEBSiHc6aZJ)_
Sign in to join this conversation.
No description provided.