[PR #2840] [MERGED] remote: a server's client doesn't load the loot tables on its first tick #4649

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2840
Author: @iLostName
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @rdbtCVS

Base: main ← Head: client-skips-loot-tables


📝 Commits (1)

  • de89e75 remote: a server's client doesn't load the loot tables on its first tick

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+7 -1)

📄 Description

What and why

The first join of a session froze the game for about half a second: the first tick's with_level loaded every loot table (~1,450 files) for client_tick_block_entities, though a client never rolls loot. A server's client (single player's window included) now passes none; the integrated server still has them. The first join's slow frame went from 535 ms to 37 ms (joining a public server, measured with HORIZON_SPIKES).

Vanilla reference

Loot tables are server data: LootTable.getRandomItems runs on a ServerLevel, and the client never loads them.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 12e0094f1, 3 min 24 s)

Check Result
Scope ✅ 1 files, +7 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 331 run, FAILED (failures=2, errors=8, skipped=11) (51 s)
rustfmt ✅ (14 s)
clippy ❌ failed (44 s)
tests: horizon-client ❌ 1151 passed, 2 failed (1 min 4 s)
doc tests ✅ 0 passed (28 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on Windows: save::session_lock_is_exclusive, crash::stacks_start_at_the_panicking_frame and the Python tests fail there and are unrelated; clippy stops at the duplicate minecraft:rabbit arm in entity_nbt.rs:502, already on main (#2719 fixes it), and is clean with that lint allowed.


🔄 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/2840 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `client-skips-loot-tables` --- ### 📝 Commits (1) - [`de89e75`](https://github.com/horizon-rust/horizon/commit/de89e758ccdaa4a6721feb7ffeb103fcc282272c) remote: a server's client doesn't load the loot tables on its first tick ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+7 -1) </details> ### 📄 Description ## What and why The first join of a session froze the game for about half a second: the first tick's `with_level` loaded every loot table (~1,450 files) for `client_tick_block_entities`, though a client never rolls loot. A server's client (single player's window included) now passes none; the integrated server still has them. The first join's slow frame went from 535 ms to 37 ms (joining a public server, measured with `HORIZON_SPIKES`). ## Vanilla reference Loot tables are server data: `LootTable.getRandomItems` runs on a `ServerLevel`, and the client never loads them. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 12e0094f1, 3 min 24 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +7 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 331 run, FAILED (failures=2, errors=8, skipped=11) (51 s) | | rustfmt | ✅ (14 s) | | clippy | ❌ failed (44 s) | | tests: horizon-client | ❌ 1151 passed, 2 failed (1 min 4 s) | | doc tests | ✅ 0 passed (28 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on Windows: `save::session_lock_is_exclusive`, `crash::stacks_start_at_the_panicking_frame` and the Python tests fail there and are unrelated; clippy stops at the duplicate `minecraft:rabbit` arm in `entity_nbt.rs:502`, already on main (#2719 fixes it), and is clean with that lint allowed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:06:55 +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#4649
No description provided.