[PR #7551] mobs: preserve baby age when pig is converted by lightning (fixes #7510) #7664

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

📋 Pull Request Information

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

Base: main ← Head: fix/7510-baby-pig-lightning-piglin


📝 Commits (2)

  • 6c5afc4 mobs: preserve baby age when pig is converted by lightning (fixes #7510)
  • cb8ae1c Merge remote-tracking branch 'origin/main' into fix/7510-baby-pig-lightning-piglin

📊 Changes

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

View changed files

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

📄 Description

🤖 Opened by glitchsnake's AI agent (Antigravity), not by glitchsnake personally.

Fixes #7510.

What and why

In vanilla Minecraft Java Edition 26.3 (Pig.thunderHit), striking a pig with lightning converts it to a zombified piglin via convertTo(..., ConversionParams.single(this, false, true), ...). This conversion preserves the mob's age, converting baby pigs into baby zombified piglins.

In Horizon, lightning.rs omitted baby: m.is_baby() when constructing SpawnSetup for the spawned zombified piglin, causing baby pigs to always spawn as adult zombified piglins. This change sets baby: m.is_baby() in SpawnSetup.

Verification

  • Added targeted unit test a_baby_pig_hit_by_lightning_becomes_a_baby_zombified_piglin in lightning.rs.
  • Ran cargo test -p horizon-client --lib game::lightning.
  • Ran python3 tools/check_public_tree.py.
  • Ran python3 tools/pr_ready.py --base origin/main --quick.

🤖 Generated with Antigravity


🔄 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/7551 **Author:** [@glitchsnake](https://github.com/glitchsnake) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/7510-baby-pig-lightning-piglin` --- ### 📝 Commits (2) - [`6c5afc4`](https://github.com/horizon-rust/horizon/commit/6c5afc49bac5834d22f597e57068123c798da6e8) mobs: preserve baby age when pig is converted by lightning (fixes #7510) - [`cb8ae1c`](https://github.com/horizon-rust/horizon/commit/cb8ae1cd7a1d6dac18885a650d9796f9b8f59485) Merge remote-tracking branch 'origin/main' into fix/7510-baby-pig-lightning-piglin ### 📊 Changes **1 file changed** (+97 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lightning.rs` (+97 -7) </details> ### 📄 Description > 🤖 Opened by glitchsnake's AI agent (Antigravity), not by glitchsnake personally. Fixes #7510. ## What and why In vanilla Minecraft Java Edition 26.3 (`Pig.thunderHit`), striking a pig with lightning converts it to a zombified piglin via `convertTo(..., ConversionParams.single(this, false, true), ...)`. This conversion preserves the mob's age, converting baby pigs into baby zombified piglins. In Horizon, `lightning.rs` omitted `baby: m.is_baby()` when constructing `SpawnSetup` for the spawned zombified piglin, causing baby pigs to always spawn as adult zombified piglins. This change sets `baby: m.is_baby()` in `SpawnSetup`. ## Verification - Added targeted unit test `a_baby_pig_hit_by_lightning_becomes_a_baby_zombified_piglin` in `lightning.rs`. - Ran `cargo test -p horizon-client --lib game::lightning`. - Ran `python3 tools/check_public_tree.py`. - Ran `python3 tools/pr_ready.py --base origin/main --quick`. 🤖 Generated with [Antigravity](https://antigravity.google.com) --- <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#7664
No description provided.