[PR #7609] Preserve signed InLove values in animal NBT #7713

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

📋 Pull Request Information

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

Base: main ← Head: fix/signed-in-love-save


📝 Commits (2)

  • bebdb71 Preserve signed InLove values in animal NBT
  • 739226a Merge main into signed InLove save fix

📊 Changes

2 files changed (+60 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+45 -1)
📝 tools/command_exec_corpus.py (+15 -0)

📄 Description

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

What and why

Fixes #7602. Writing a pig loaded with InLove:-32769 now preserves -32769 instead of replacing it with zero. Remove the animal NBT writer's max(0) clamp; the reader already stores the signed integer.

The codec regression fails on the old writer and passes with the direct field write. It covers integer -32769, -32768, -129, -128 and -1; byte -1b and -128b; zero and positive controls; output as Tag::Int both with and without a prior compound; and the zero default after removing the field. The native command corpus adds 30 observations without advancing ticks.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Java 26.3 Animal.addAdditionalSaveData writes inLove directly with putInt; readAdditionalSaveData uses getIntOr("InLove",0). These checks concern signed integer field serialization. Floating numeric conversion, LoveCause and age ticking are separate; no breeding behavior claim is made.

Fresh Java 26.3/native command parity passes 30/30 observations without advancing ticks. All 20 field reads independently return the expected signed integer or zero after removal; the ten removal replies also match. Breeding and tick behavior remain outside this check.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at 31f83499b, 7 min 7 s)

Check Result
Scope ✅ 2 files, +62 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (53 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 21 s)
tests: horizon-client-lib ✅ 1491 passed (4 min 45 s)
doc tests ✅ 0 passed (1 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 codec regression fails before the fix (Int(0) instead of Int(-32769)) and passes afterward.

🤖 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/7609 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/signed-in-love-save` --- ### 📝 Commits (2) - [`bebdb71`](https://github.com/horizon-rust/horizon/commit/bebdb71d766742dae173ca087b3501764f87bc02) Preserve signed InLove values in animal NBT - [`739226a`](https://github.com/horizon-rust/horizon/commit/739226a194c09229e4ac03a1c07950d0cd3bc8a3) Merge main into signed InLove save fix ### 📊 Changes **2 files changed** (+60 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+45 -1) 📝 `tools/command_exec_corpus.py` (+15 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why Fixes #7602. Writing a pig loaded with `InLove:-32769` now preserves -32769 instead of replacing it with zero. Remove the animal NBT writer's `max(0)` clamp; the reader already stores the signed integer. The codec regression fails on the old writer and passes with the direct field write. It covers integer -32769, -32768, -129, -128 and -1; byte -1b and -128b; zero and positive controls; output as Tag::Int both with and without a prior compound; and the zero default after removing the field. The native command corpus adds 30 observations without advancing ticks. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Java 26.3 `Animal.addAdditionalSaveData` writes inLove directly with `putInt`; `readAdditionalSaveData` uses `getIntOr("InLove",0)`. These checks concern signed integer field serialization. Floating numeric conversion, LoveCause and age ticking are separate; no breeding behavior claim is made. Fresh Java 26.3/native command parity passes **30/30 observations** without advancing ticks. All 20 field reads independently return the expected signed integer or zero after removal; the ten removal replies also match. Breeding and tick behavior remain outside this check. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at 31f83499b, 7 min 7 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +62 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (53 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 21 s) | | tests: horizon-client-lib | ✅ 1491 passed (4 min 45 s) | | doc tests | ✅ 0 passed (1 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 codec regression fails before the fix (Int(0) instead of Int(-32769)) and passes afterward. 🤖 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#7713
No description provided.