[PR #6174] [MERGED] Give a zombie nautilus spawn egg its variant #6698

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6174
Author: @MSedgeMC
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/zombie-nautilus-variant


📝 Commits (2)

  • c7286ed Give a zombie nautilus spawn egg its variant
  • f58c0ae Fit the new match arm on one line

📊 Changes

1 file changed (+12 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+12 -0)

📄 Description

ZombieNautilus.applyImplicitComponents applies DataComponents.ZOMBIE_NAUTILUS_VARIANT
(minecraft:zombie_nautilus/variant, registry values minecraft:temperate and
minecraft:warm) before the superclass call:

// javap -p -c on ZombieNautilus
0: aload_0
1: aload_1
2: getstatic     DataComponents.ZOMBIE_NAUTILUS_VARIANT
5: invokevirtual applyImplicitComponentIfPresent
9: aload_0  10: aload_1  11: invokespecial AbstractNautilus.applyImplicitComponents

apply_item_components already applied the same component for chickens, cows and pigs, and
finalize::variant_index already knows the nautilus' temperate/warm order, but the match
had no ZombieNautilus arm, so a zombie nautilus spawn egg or bucket left the biome's
temperate variant alone.

Proven: on the build VM, cargo test -q -p horizon-client --lib a_spawn_egg_beats_the_biome_variant
→ 1 passed, and with the new arm deleted the same test → FAILED, so the assertion reaches
the behaviour rather than passing vacuously.

Not proven: not checked in game. The in-game check: use a zombie nautilus spawn egg with the
coral variant in a temperate ocean.

One deliberate limit: the arm reads the component through text(components.other(..)) like the
chicken and pig arms beside it, so an unknown registry name falls back to variant_index's 0
(temperate) instead of being rejected as invalid.


🔄 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/6174 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/zombie-nautilus-variant` --- ### 📝 Commits (2) - [`c7286ed`](https://github.com/horizon-rust/horizon/commit/c7286edfbea165960867fbbeb2c3890804f65ff7) Give a zombie nautilus spawn egg its variant - [`f58c0ae`](https://github.com/horizon-rust/horizon/commit/f58c0ae1bf2798fa416be868bcc7a727d6814045) Fit the new match arm on one line ### 📊 Changes **1 file changed** (+12 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+12 -0) </details> ### 📄 Description `ZombieNautilus.applyImplicitComponents` applies `DataComponents.ZOMBIE_NAUTILUS_VARIANT` (`minecraft:zombie_nautilus/variant`, registry values `minecraft:temperate` and `minecraft:warm`) before the superclass call: ```java // javap -p -c on ZombieNautilus 0: aload_0 1: aload_1 2: getstatic DataComponents.ZOMBIE_NAUTILUS_VARIANT 5: invokevirtual applyImplicitComponentIfPresent 9: aload_0 10: aload_1 11: invokespecial AbstractNautilus.applyImplicitComponents ``` `apply_item_components` already applied the same component for chickens, cows and pigs, and `finalize::variant_index` already knows the nautilus' `temperate`/`warm` order, but the match had no `ZombieNautilus` arm, so a zombie nautilus spawn egg or bucket left the biome's temperate variant alone. **Proven:** on the build VM, `cargo test -q -p horizon-client --lib a_spawn_egg_beats_the_biome_variant` → `1 passed`, and with the new arm deleted the same test → `FAILED`, so the assertion reaches the behaviour rather than passing vacuously. **Not proven:** not checked in game. The in-game check: use a zombie nautilus spawn egg with the coral variant in a temperate ocean. One deliberate limit: the arm reads the component through `text(components.other(..))` like the chicken and pig arms beside it, so an unknown registry name falls back to `variant_index`'s 0 (temperate) instead of being rejected as invalid. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25:05 +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#6698
No description provided.