[PR #2543] [MERGED] Minecarts save HasTicked and Fire 0 #4413

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2543
Author: @FusselTV
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/minecart-first-tick


📝 Commits (1)

  • a55c825 Minecarts save HasTicked and Fire 0

📊 Changes

2 files changed (+38 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/minecarts.rs (+35 -0)
📝 crates/horizon-world/src/worldgen/structure/mineshaft.rs (+3 -0)

📄 Description

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

What and why

AbstractMinecart saves Entity.firstTick as HasTicked, and a cart's Fire stays 0: Entity.move sets it to -getFireImmuneTicks(), which is 0 for everything but players. Horizon saved a mineshaft's chest minecart without HasTicked and with Fire: -1.

Vanilla saves:

  • a generated cart that never ticked: HasTicked 1, Fire 0 (92 of 92 carts of seed 1);
  • a cart that has ticked: HasTicked 0, Fire 0.

What changes:

  • The mineshaft writes HasTicked 1 and Fire 0, as the proto chunk saves a new cart.
  • A cart keeps first_tick from its save until its first tick, and saves it as HasTicked with Fire 0.

Vanilla reference

  • AbstractMinecart.readAdditionalSaveData / addAdditionalSaveData: HasTicked ↔ firstTick.
  • Entity.move: setRemainingFireTicks(-getFireImmuneTicks()); Entity.getFireImmuneTicks returns 0 (only Player overrides it).

Tests

  • New unit test game::minecarts::tests::a_cart_saves_as_never_ticked_until_it_ticks.
  • End to end over seeds 12345, 1 and 8675309: before, all 238 generated chest minecarts differed from vanilla in HasTicked and Fire. After: all of them save as vanilla does.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on 2a7c7288336d, against upstream/main at cb43e3278, 7 min 22 s)

Check Result
Scope ✅ 2 files, +38 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 320 passed (22 s)
rustfmt ✅ (6 s)
clippy ✅ (45 s)
tests: horizon-client, horizon-world ✅ 1579 passed (5 min 22 s)
doc tests ✅ 0 passed (45 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 332 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 320 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/2543 **Author:** [@FusselTV](https://github.com/FusselTV) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/minecart-first-tick` --- ### 📝 Commits (1) - [`a55c825`](https://github.com/horizon-rust/horizon/commit/a55c82546773cc719e2e8dd291476c87be1b7686) Minecarts save HasTicked and Fire 0 ### 📊 Changes **2 files changed** (+38 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/minecarts.rs` (+35 -0) 📝 `crates/horizon-world/src/worldgen/structure/mineshaft.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally. ## What and why `AbstractMinecart` saves `Entity.firstTick` as `HasTicked`, and a cart's `Fire` stays 0: `Entity.move` sets it to `-getFireImmuneTicks()`, which is 0 for everything but players. Horizon saved a mineshaft's chest minecart without `HasTicked` and with `Fire: -1`. Vanilla saves: - a generated cart that never ticked: `HasTicked 1`, `Fire 0` (92 of 92 carts of seed 1); - a cart that has ticked: `HasTicked 0`, `Fire 0`. What changes: - The mineshaft writes `HasTicked 1` and `Fire 0`, as the proto chunk saves a new cart. - A cart keeps `first_tick` from its save until its first tick, and saves it as `HasTicked` with `Fire 0`. ## Vanilla reference - `AbstractMinecart.readAdditionalSaveData` / `addAdditionalSaveData`: `HasTicked` ↔ `firstTick`. - `Entity.move`: `setRemainingFireTicks(-getFireImmuneTicks())`; `Entity.getFireImmuneTicks` returns 0 (only `Player` overrides it). ## Tests - New unit test `game::minecarts::tests::a_cart_saves_as_never_ticked_until_it_ticks`. - End to end over seeds 12345, 1 and 8675309: before, all 238 generated chest minecarts differed from vanilla in `HasTicked` and `Fire`. After: all of them save as vanilla does. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on 2a7c7288336d, against upstream/main at cb43e3278, 7 min 22 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +38 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 320 passed (22 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (45 s) | | tests: horizon-client, horizon-world | ✅ 1579 passed (5 min 22 s) | | doc tests | ✅ 0 passed (45 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 332 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 320 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:16:58 +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#4413
No description provided.