[PR #5057] [MERGED] Save a mob halfway through converting #6032

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5057
Author: @MSedgeMC
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/conversion-save


📝 Commits (4)

  • d38e8d4 Save a mob halfway through converting
  • dc2c9e7 Merge origin/main into fix: entity_nbt conflict (conversion times beside the block-state helpers)
  • ed68b03 Merge origin/main into fix/conversion-save (main's build fix #5251)
  • 0e11d40 Merge origin/main into fix/conversion-save (main's clippy fix #5304)

📊 Changes

1 file changed (+96 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+96 -2)

📄 Description

Fixes the read half of ConversionTracker's save data in the port ledger. (No issue.)

Vanilla's ConversionTracker.readAdditionalSaveData reads afflictionTime (default 0) and conversionTime (default −1), and a non-−1 conversion time calls startConversion — so a zombie saved 300 ticks into drowning, or a skeleton saved mid-freeze, resumes converting after a reload, and a mob whose NBT carries the tags (a /summon, or a world written by vanilla) starts converting at once. The tag names come from each mob's own tracker: InWaterTime/DrownedConversionTime for zombie and husk, FreezingTime/StrayConversionTime for skeleton.

Horizon simulated both conversions and saved nothing: the write side emitted a literal -1 for the drowned pair and nothing at all for the skeleton, and there was no reader, so a mob saved mid-conversion restarted from scratch and an NBT-supplied conversion was ignored entirely.

Proven: the extended round-trip test in entity_nbt.rs passes on a build box, and the whole horizon-client lib suite passes with it (940 passed): a zombie mid-conversion round-trips with both tags and comes back counting, a zombie not converting writes −1 and comes back not converting, and the skeleton pair likewise.

Not proven: nothing in a game — the honest check is /summon minecraft:zombie ~ ~ ~ {InWaterTime:599,DrownedConversionTime:300}, watch it turn into a drowned, then save and reload halfway and confirm the countdown resumes rather than restarting.


🔄 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/5057 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/conversion-save` --- ### 📝 Commits (4) - [`d38e8d4`](https://github.com/horizon-rust/horizon/commit/d38e8d4ecb0131c56068f0d709a5eac0160ecb6b) Save a mob halfway through converting - [`dc2c9e7`](https://github.com/horizon-rust/horizon/commit/dc2c9e7b464f90e4c8acf75b281c61c0932391e2) Merge origin/main into fix: entity_nbt conflict (conversion times beside the block-state helpers) - [`ed68b03`](https://github.com/horizon-rust/horizon/commit/ed68b03b4ee79b6b1f954b71e7a19711b3d07952) Merge origin/main into fix/conversion-save (main's build fix #5251) - [`0e11d40`](https://github.com/horizon-rust/horizon/commit/0e11d408de695a6ff01508dadb3c3c2bb9505a10) Merge origin/main into fix/conversion-save (main's clippy fix #5304) ### 📊 Changes **1 file changed** (+96 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+96 -2) </details> ### 📄 Description Fixes the read half of `ConversionTracker`'s save data in the port ledger. (No issue.) Vanilla's `ConversionTracker.readAdditionalSaveData` reads `afflictionTime` (default 0) and `conversionTime` (default −1), and a non-−1 conversion time calls `startConversion` — so a zombie saved 300 ticks into drowning, or a skeleton saved mid-freeze, resumes converting after a reload, and a mob whose NBT carries the tags (a `/summon`, or a world written by vanilla) starts converting at once. The tag names come from each mob's own tracker: `InWaterTime`/`DrownedConversionTime` for zombie and husk, `FreezingTime`/`StrayConversionTime` for skeleton. Horizon simulated both conversions and saved nothing: the write side emitted a literal `-1` for the drowned pair and nothing at all for the skeleton, and there was no reader, so a mob saved mid-conversion restarted from scratch and an NBT-supplied conversion was ignored entirely. **Proven:** the extended round-trip test in `entity_nbt.rs` passes on a build box, and the whole `horizon-client` lib suite passes with it (940 passed): a zombie mid-conversion round-trips with both tags and comes back counting, a zombie not converting writes −1 and comes back not converting, and the skeleton pair likewise. **Not proven:** nothing in a game — the honest check is `/summon minecraft:zombie ~ ~ ~ {InWaterTime:599,DrownedConversionTime:300}`, watch it turn into a drowned, then save and reload halfway and confirm the countdown resumes rather than restarting. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:45 +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#6032
No description provided.