[PR #1570] [MERGED] Server resource packs: prompt, Server Resource Packs setting, apply and remove #3597

Closed
opened 2026-11-03 04:10:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1570
Author: @ludovic111
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: feat/server-packs-client


📝 Commits (2)

  • cdfcc3d Server resource packs: the client's pack manager and downloads
  • 186ab70 Server resource packs: prompt, Server Resource Packs setting, apply and remove

📊 Changes

18 files changed (+2262 additions, -89 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/horizon-client/Cargo.toml (+2 -0)
➕ crates/horizon-client/src/confirm_screen.rs (+75 -0)
📝 crates/horizon-client/src/game.rs (+29 -2)
📝 crates/horizon-client/src/game/game_rules_screen.rs (+16 -52)
📝 crates/horizon-client/src/game/packs.rs (+20 -11)
📝 crates/horizon-client/src/game/remote.rs (+13 -0)
➕ crates/horizon-client/src/game/server_packs.rs (+316 -0)
📝 crates/horizon-client/src/game/startup_menu.rs (+3 -4)
📝 crates/horizon-client/src/lib.rs (+2 -0)
📝 crates/horizon-client/src/multiplayer.rs (+94 -2)
📝 crates/horizon-client/src/net.rs (+58 -15)
📝 crates/horizon-client/src/packs.rs (+11 -0)
➕ crates/horizon-client/src/server_packs.rs (+618 -0)
➕ crates/horizon-client/src/server_packs/download.rs (+482 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+3 -2)
📝 docs/resource-packs.md (+3 -1)
➕ tools/server_pack_e2e.py (+516 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Server resource packs, part 3 of 3: servers that push a resource pack now work. Reported on Discord by scanfee: "Servers requiring custom resource packs do not work yet". Until now net.rs declined every push.

Stacked on #1569 (part 2: the pack manager and downloads), so this PR's base is that branch. Part 1 (#1562) makes Horizon's dedicated server offer server.properties' pack. Merge order: #1562, #1569, this one.

What changes for players

  • The prompt. This is vanilla's PackConfirmScreen.
    • A required pack gets "This server requires the use of a custom resource pack." and the yellow warning, with Proceed and Disconnect.
    • An optional pack gets "This server recommends…" with Yes and No.
    • The server's own message comes under "Message from server:". Escape answers no.
    • Several packs pushed before the answer share one prompt.
    • During configuration the prompt replaces the connecting screen. In game it opens over the world.
  • Declining a required pack disconnects with "This server requires a custom resource pack". As in vanilla, no status is sent: the client leaves at once.
  • The setting. The server list's Edit screen has vanilla's Server Resource Packs: Prompt / Enabled / Disabled cycle button (manageServer.resourcePack, at height / 4 + 72), saved in servers.dat as acceptTextures. Answering the prompt saves it too, as ServerList.saveSingleServer does.
  • Applying the pack. Downloaded packs go on top of the player's own packs, in push order, through the same reload as the Resource Packs screen, with no restart. They are removed on resource_pack_pop and when leaving the server.
  • Both phases. Push and pop work in configuration and in play, and statuses are sent in the phase the connection is in. A flag is changed under the writer lock when the client sends finish_configuration or configuration_acknowledged.
  • Single player's own server takes its packs quietly (configureForLocalWorld).

confirm_screen.rs is vanilla's ConfirmScreen layout, now shared with the game rules screen's discard prompt (that screen's local copy is removed).

Proof

tools/server_pack_e2e.py is new. It runs the real client (offscreen, driven by horizon-ctl) against a real dedicated server, through tools/net_capture.py, which records the statuses the client sends.

  • The test pack is built by the script: dirt recoloured blue, plus block.minecraft.dirt, menu.returnToGame and selectServer.select strings. It is served by a local HTTP server.
  • Every game and server gets fresh temporary HORIZON_HOME, HORIZON_LAUNCHER_HOME and XDG_* folders.
Scenario Statuses the client sends Also checked
required, Prompt, Disconnect none (as vanilla) disconnected with "This server requires a custom resource pack"; setting stays Prompt; nothing downloaded
required, Prompt, Proceed ACCEPTED, DOWNLOADED, SUCCESSFULLY_LOADED setting becomes Enabled; downloads/<id>/<sha1> and its log.json entry; the request's X-Minecraft-* and User-Agent headers; the ground is the pack's blue dirt (screenshot, 95% of samples blue); the pause menu shows "Back to Game (server pack)"; after leaving, the server list says "Join Server" again (pack removed)
required, Enabled ACCEPTED, DOWNLOADED, SUCCESSFULLY_LOADED no prompt; no second HTTP request (cache); pack applied
required, wrong SHA-1 ACCEPTED, FAILED_DOWNLOAD still joins; log.json records download_failed
optional, Prompt, No DECLINED joins; setting becomes Disabled
optional, Disabled DECLINED no prompt
optional, Prompt, Yes, no hash given ACCEPTED, DOWNLOADED, SUCCESSFULLY_LOADED downloaded and stored under its own SHA-1
optional, dead URL ACCEPTED, FAILED_DOWNLOAD joins

Results:

  • Against vanilla 26.3's dedicated server: 8/8 pass.
  • Against Horizon's dedicated server (with #1562): 8/8 pass.
  • Before (origin/main's client against vanilla's server): 7/8 fail. The prompt never opens, and every pack gets DECLINED. "Disabled" passes only because main declines everything.

Screenshots (prompt required, prompt optional, blue dirt applied) are on the Mac mini in ~/code/horizon-parity/evidence/server-packs-1/.

New unit test: edit_cycles_and_saves_the_server_resource_pack_setting (the cycle button's place, label and order; Cancel keeps the saved value, Done saves it; a new server is Prompt).

Not done, and listed in docs/resource-packs.md: the download progress toasts (download.pack.*).

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 535f2d2a0, so it includes part 2)

Check Result
Scope ⚠️ 18 files, +2262 −89 with part 2. This PR alone is 14 files, +1158 −89: 510 lines are the e2e driver, the rest is the game wiring
Cargo.lock ✅ changes with a Cargo.toml (part 2's sha1)
Public tree ✅
Python tests ❌ 289 run, 2 errors. Both fail on main on macOS too (test_parity_runner, test_rust_parity: /var vs /private/var and the java path), so they are unrelated
rustfmt ✅
clippy ✅
tests: workspace ✅ 2002 passed
doc tests ✅
Parity ➖ 325 affected harnesses, left to CI

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1570 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/server-packs-client` --- ### 📝 Commits (2) - [`cdfcc3d`](https://github.com/horizon-rust/horizon/commit/cdfcc3d4d446e59c075e6fd0018a8cc599519cdc) Server resource packs: the client's pack manager and downloads - [`186ab70`](https://github.com/horizon-rust/horizon/commit/186ab70305dd8190745b6513524d241adfb62654) Server resource packs: prompt, Server Resource Packs setting, apply and remove ### 📊 Changes **18 files changed** (+2262 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/horizon-client/Cargo.toml` (+2 -0) ➕ `crates/horizon-client/src/confirm_screen.rs` (+75 -0) 📝 `crates/horizon-client/src/game.rs` (+29 -2) 📝 `crates/horizon-client/src/game/game_rules_screen.rs` (+16 -52) 📝 `crates/horizon-client/src/game/packs.rs` (+20 -11) 📝 `crates/horizon-client/src/game/remote.rs` (+13 -0) ➕ `crates/horizon-client/src/game/server_packs.rs` (+316 -0) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+3 -4) 📝 `crates/horizon-client/src/lib.rs` (+2 -0) 📝 `crates/horizon-client/src/multiplayer.rs` (+94 -2) 📝 `crates/horizon-client/src/net.rs` (+58 -15) 📝 `crates/horizon-client/src/packs.rs` (+11 -0) ➕ `crates/horizon-client/src/server_packs.rs` (+618 -0) ➕ `crates/horizon-client/src/server_packs/download.rs` (+482 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+3 -2) 📝 `docs/resource-packs.md` (+3 -1) ➕ `tools/server_pack_e2e.py` (+516 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Server resource packs, part 3 of 3: servers that push a resource pack now work. Reported on Discord by scanfee: "Servers requiring custom resource packs do not work yet". Until now `net.rs` declined every push. Stacked on #1569 (part 2: the pack manager and downloads), so this PR's base is that branch. Part 1 (#1562) makes Horizon's dedicated server offer `server.properties`' pack. Merge order: #1562, #1569, this one. ## What changes for players - **The prompt.** This is vanilla's `PackConfirmScreen`. - A required pack gets "This server requires the use of a custom resource pack." and the yellow warning, with Proceed and Disconnect. - An optional pack gets "This server recommends…" with Yes and No. - The server's own message comes under "Message from server:". Escape answers no. - Several packs pushed before the answer share one prompt. - During configuration the prompt replaces the connecting screen. In game it opens over the world. - **Declining a required pack** disconnects with "This server requires a custom resource pack". As in vanilla, no status is sent: the client leaves at once. - **The setting.** The server list's Edit screen has vanilla's **Server Resource Packs: Prompt / Enabled / Disabled** cycle button (`manageServer.resourcePack`, at `height / 4 + 72`), saved in `servers.dat` as `acceptTextures`. Answering the prompt saves it too, as `ServerList.saveSingleServer` does. - **Applying the pack.** Downloaded packs go on top of the player's own packs, in push order, through the same reload as the Resource Packs screen, with no restart. They are removed on `resource_pack_pop` and when leaving the server. - **Both phases.** Push and pop work in configuration and in play, and statuses are sent in the phase the connection is in. A flag is changed under the writer lock when the client sends `finish_configuration` or `configuration_acknowledged`. - **Single player's own server** takes its packs quietly (`configureForLocalWorld`). `confirm_screen.rs` is vanilla's `ConfirmScreen` layout, now shared with the game rules screen's discard prompt (that screen's local copy is removed). ## Proof `tools/server_pack_e2e.py` is new. It runs the real client (offscreen, driven by `horizon-ctl`) against a real dedicated server, through `tools/net_capture.py`, which records the statuses the client sends. - The test pack is built by the script: dirt recoloured blue, plus `block.minecraft.dirt`, `menu.returnToGame` and `selectServer.select` strings. It is served by a local HTTP server. - Every game and server gets fresh temporary `HORIZON_HOME`, `HORIZON_LAUNCHER_HOME` and `XDG_*` folders. | Scenario | Statuses the client sends | Also checked | | --- | --- | --- | | required, Prompt, **Disconnect** | none (as vanilla) | disconnected with "This server requires a custom resource pack"; setting stays Prompt; nothing downloaded | | required, Prompt, **Proceed** | ACCEPTED, DOWNLOADED, SUCCESSFULLY_LOADED | setting becomes Enabled; `downloads/<id>/<sha1>` and its `log.json` entry; the request's `X-Minecraft-*` and `User-Agent` headers; the ground is the pack's blue dirt (screenshot, 95% of samples blue); the pause menu shows "Back to Game (server pack)"; after leaving, the server list says "Join Server" again (pack removed) | | required, **Enabled** | ACCEPTED, DOWNLOADED, SUCCESSFULLY_LOADED | no prompt; no second HTTP request (cache); pack applied | | required, **wrong SHA-1** | ACCEPTED, FAILED_DOWNLOAD | still joins; `log.json` records `download_failed` | | optional, Prompt, **No** | DECLINED | joins; setting becomes Disabled | | optional, **Disabled** | DECLINED | no prompt | | optional, Prompt, **Yes**, no hash given | ACCEPTED, DOWNLOADED, SUCCESSFULLY_LOADED | downloaded and stored under its own SHA-1 | | optional, **dead URL** | ACCEPTED, FAILED_DOWNLOAD | joins | Results: - **Against vanilla 26.3's dedicated server:** 8/8 pass. - **Against Horizon's dedicated server** (with #1562): 8/8 pass. - **Before** (origin/main's client against vanilla's server): 7/8 fail. The prompt never opens, and every pack gets DECLINED. "Disabled" passes only because main declines everything. Screenshots (prompt required, prompt optional, blue dirt applied) are on the Mac mini in `~/code/horizon-parity/evidence/server-packs-1/`. New unit test: `edit_cycles_and_saves_the_server_resource_pack_setting` (the cycle button's place, label and order; Cancel keeps the saved value, Done saves it; a new server is Prompt). Not done, and listed in `docs/resource-packs.md`: the download progress toasts (`download.pack.*`). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 535f2d2a0, so it includes part 2) | Check | Result | | --- | --- | | Scope | ⚠️ 18 files, +2262 −89 with part 2. This PR alone is 14 files, +1158 −89: 510 lines are the e2e driver, the rest is the game wiring | | Cargo.lock | ✅ changes with a Cargo.toml (part 2's `sha1`) | | Public tree | ✅ | | Python tests | ❌ 289 run, 2 errors. Both fail on main on macOS too (`test_parity_runner`, `test_rust_parity`: `/var` vs `/private/var` and the java path), so they are unrelated | | rustfmt | ✅ | | clippy | ✅ | | tests: workspace | ✅ 2002 passed | | doc tests | ✅ | | Parity | ➖ 325 affected harnesses, left to CI | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:41 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3597
No description provided.