[PR #4639] [MERGED] Reload sends tags and recipes and reloads advancements; code of conduct task #5746

Closed
opened 2026-11-03 05:14:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4639
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/37-deathmsg


📝 Commits (1)

  • be04458 Reload: send tags, recipes and the recipe book to players and reload their advancements; offer the code of conduct

📊 Changes

7 files changed (+358 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+12 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+8 -0)
📝 crates/horizon-client/src/lan/advancements.rs (+44 -0)
➕ crates/horizon-client/src/lan/code_of_conduct.rs (+159 -0)
📝 crates/horizon-client/src/lan/conn.rs (+64 -13)
📝 crates/horizon-client/src/lan/hub.rs (+54 -12)
📝 crates/horizon-client/src/lan/mod.rs (+17 -2)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3520

What and why

  • PlayerList.reloadResources: /reload now sends every player the tags (ClientboundUpdateTagsPacket), the recipes and their recipe book again, and reloads their advancements. Hub::reload_resources swaps the hub's and the login path's sync data (Shared::set_sync, so new joiners get the reloaded data too) and ServerAdvancements::reload ports PlayerAdvancements.reload (progress for an advancement or criterion that no longer exists is dropped, the next flushDirty is a first packet again, new minecraft:tick criteria are met and their recipes rewarded). Called from Game::reload_world_tables.
  • ServerConfigurationPacketListenerImpl.addOptionalTasks: enable-code-of-conduct reads codeofconduct/<language>.txt at start (DedicatedServer.readCodeOfConducts: lowercased names, StringUtil.stripColor, readAllLines joined with \n, a missing folder stops the start) and configuration offers the player's language, else en_us, else the first, before the resource pack, waiting for AcceptCodeOfConduct (lan/code_of_conduct.rs, lan/conn.rs). offer_pack's wait loop became a shared wait_alive.

Rows found already right on main (no change): PlayerList.broadcastSystemToTeam / broadcastSystemToAllExceptTeam (horizon_client_core::scoreboard::death_message_reaches), RecipeCraftedTrigger.trigger for player crafting (menu.crafted -> trigger_recipe_crafted).

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

PlayerList.reloadResources, PlayerAdvancements.reload, ServerConfigurationPacketListenerImpl.addOptionalTasks / handleAcceptCodeOfConduct, ServerCodeOfConductConfigurationTask, DedicatedServer.readCodeOfConducts, StringUtil.stripColor.

Tests: lan::code_of_conduct::tests::* (language pick, colour strip and line joining, missing folder, file reading). The reload path needs the vanilla data and is not unit tested; fmt, clippy -p horizon-client --all-targets -D warnings pass.

🤖 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/4639 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/37-deathmsg` --- ### 📝 Commits (1) - [`be04458`](https://github.com/horizon-rust/horizon/commit/be0445848da898acbfd5d3b17f54ab70f61b4bcc) Reload: send tags, recipes and the recipe book to players and reload their advancements; offer the code of conduct ### 📊 Changes **7 files changed** (+358 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+12 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+8 -0) 📝 `crates/horizon-client/src/lan/advancements.rs` (+44 -0) ➕ `crates/horizon-client/src/lan/code_of_conduct.rs` (+159 -0) 📝 `crates/horizon-client/src/lan/conn.rs` (+64 -13) 📝 `crates/horizon-client/src/lan/hub.rs` (+54 -12) 📝 `crates/horizon-client/src/lan/mod.rs` (+17 -2) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520 ## What and why - `PlayerList.reloadResources`: `/reload` now sends every player the tags (`ClientboundUpdateTagsPacket`), the recipes and their recipe book again, and reloads their advancements. `Hub::reload_resources` swaps the hub's and the login path's sync data (`Shared::set_sync`, so new joiners get the reloaded data too) and `ServerAdvancements::reload` ports `PlayerAdvancements.reload` (progress for an advancement or criterion that no longer exists is dropped, the next `flushDirty` is a first packet again, new `minecraft:tick` criteria are met and their recipes rewarded). Called from `Game::reload_world_tables`. - `ServerConfigurationPacketListenerImpl.addOptionalTasks`: `enable-code-of-conduct` reads `codeofconduct/<language>.txt` at start (`DedicatedServer.readCodeOfConducts`: lowercased names, `StringUtil.stripColor`, `readAllLines` joined with `\n`, a missing folder stops the start) and configuration offers the player's language, else `en_us`, else the first, before the resource pack, waiting for `AcceptCodeOfConduct` (`lan/code_of_conduct.rs`, `lan/conn.rs`). `offer_pack`'s wait loop became a shared `wait_alive`. Rows found already right on main (no change): `PlayerList.broadcastSystemToTeam` / `broadcastSystemToAllExceptTeam` (`horizon_client_core::scoreboard::death_message_reaches`), `RecipeCraftedTrigger.trigger` for player crafting (`menu.crafted` -> `trigger_recipe_crafted`). ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `PlayerList.reloadResources`, `PlayerAdvancements.reload`, `ServerConfigurationPacketListenerImpl.addOptionalTasks` / `handleAcceptCodeOfConduct`, `ServerCodeOfConductConfigurationTask`, `DedicatedServer.readCodeOfConducts`, `StringUtil.stripColor`. Tests: `lan::code_of_conduct::tests::*` (language pick, colour strip and line joining, missing folder, file reading). The reload path needs the vanilla data and is not unit tested; `fmt`, `clippy -p horizon-client --all-targets -D warnings` pass. 🤖 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 05:14:43 +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#5746
No description provided.