[PR #7851] Gate saved InWaterTime on cached eye immersion #7864

Open
opened 2026-11-03 07:25:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7851
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/h136-in-water-time


📝 Commits (1)

  • 842fbf1 Gate saved InWaterTime on cached eye immersion

📊 Changes

3 files changed (+184 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+7 -0)
📝 tools/port_map/game-004.tsv (+1 -1)
➕ tools/test_conversion_water_save_parity.py (+176 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

A zombie's supplied InWaterTime currently survives saving even when its eyes are out of water. Apply ConversionTracker's live affliction predicate in the existing shared Zombie-derived save block: write -1 when the current cached eye-water state is false. Fixes #7823.

The initial submerged snapshot must also be -1, because the entity has not updated its fluid cache yet. Later immersed snapshots retain the supplied counter; feet-only water and removal of water save -1. The writer changes only the saved tag, preserving the counter for later snapshots.

Add real dedicated-server controls. The four zombie scenes improve 47/56 → 56/56; dry controls for husk, drowned, zombie villager and zombified piglin improve 32/44 → 44/44. Total 79/100 → 100/100, with an unchanged fixture hash and identical fresh Java 26.3 records. Every old difference is InWaterTime; position, eye-block, existence and the primary conversion-counter controls match.

The existing positive counter codec fixture now explicitly has immersed eyes. Counter progression, general default-counter modeling, packets and reload behavior remain outside this change; the port map retains the separate raw-NBT/progress gap.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Java 26.3 ConversionTracker.addAdditionalSaveData writes the affliction counter only when its isAfflicted supplier is true, otherwise -1. Zombie supplies isEyeInFluid(FluidTags.WATER), which reads the cached eye state. Inspected the pinned official bytecode, including the constructor's supplier lambda.

Regression: python3 tools/test_conversion_water_save_parity.py. Fresh loaded scenes, frozen simulation with actual tick completion, supplied counters, before/after fluid-cache updates and water removal. This checks the saved predicate without enabling conversion countdowns.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on local validation, against origin/main at 0bcd2f156, 33 min 14 s)

Check Result
Scope ✅ 3 files, +184 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (2 min 43 s)
rustfmt ✅ (18 s)
clippy ✅ (4 min 16 s)
tests: horizon-client-lib ✅ 1476 passed (25 min 53 s)
doc tests ✅ 0 passed (4 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks 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)

The focused old/fixed runtime above was run separately. Full affected parity was not run locally (--quick).

🤖 Generated with Codex


🔄 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/7851 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/h136-in-water-time` --- ### 📝 Commits (1) - [`842fbf1`](https://github.com/horizon-rust/horizon/commit/842fbf138ae131c9f3f164dd6af520f03aeb00de) Gate saved InWaterTime on cached eye immersion ### 📊 Changes **3 files changed** (+184 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+7 -0) 📝 `tools/port_map/game-004.tsv` (+1 -1) ➕ `tools/test_conversion_water_save_parity.py` (+176 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why A zombie's supplied `InWaterTime` currently survives saving even when its eyes are out of water. Apply `ConversionTracker`'s live affliction predicate in the existing shared Zombie-derived save block: write `-1` when the current cached eye-water state is false. Fixes #7823. The initial submerged snapshot must also be `-1`, because the entity has not updated its fluid cache yet. Later immersed snapshots retain the supplied counter; feet-only water and removal of water save `-1`. The writer changes only the saved tag, preserving the counter for later snapshots. Add real dedicated-server controls. The four zombie scenes improve **47/56 → 56/56**; dry controls for husk, drowned, zombie villager and zombified piglin improve **32/44 → 44/44**. Total **79/100 → 100/100**, with an unchanged fixture hash and identical fresh Java 26.3 records. Every old difference is `InWaterTime`; position, eye-block, existence and the primary conversion-counter controls match. The existing positive counter codec fixture now explicitly has immersed eyes. Counter progression, general default-counter modeling, packets and reload behavior remain outside this change; the port map retains the separate raw-NBT/progress gap. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Java 26.3 `ConversionTracker.addAdditionalSaveData` writes the affliction counter only when its `isAfflicted` supplier is true, otherwise `-1`. `Zombie` supplies `isEyeInFluid(FluidTags.WATER)`, which reads the cached eye state. Inspected the pinned official bytecode, including the constructor's supplier lambda. Regression: `python3 tools/test_conversion_water_save_parity.py`. Fresh loaded scenes, frozen simulation with actual tick completion, supplied counters, before/after fluid-cache updates and water removal. This checks the saved predicate without enabling conversion countdowns. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on local validation, against origin/main at 0bcd2f156, 33 min 14 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +184 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (2 min 43 s) | | rustfmt | ✅ (18 s) | | clippy | ✅ (4 min 16 s) | | tests: horizon-client-lib | ✅ 1476 passed (25 min 53 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks 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) | The focused old/fixed runtime above was run separately. Full affected parity was not run locally (`--quick`). 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7864
No description provided.