[PR #4515] [MERGED] Let a brown mooshroom take a flower's stew effects #5666

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

📋 Pull Request Information

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

Base: main ← Head: fix/mooshroom-stew


📝 Commits (1)

  • 87231ee Let a brown mooshroom take a flower's stew effects

📊 Changes

10 files changed (+205 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+48 -3)
📝 crates/horizon-client/src/game/creatures.rs (+62 -3)
📝 crates/horizon-client/src/game/remote_mob_use.rs (+6 -4)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/mobs.rs (+3 -0)
➕ crates/horizon-items/src/flowers.rs (+78 -0)
📝 crates/horizon-items/src/lib.rs (+1 -0)
📝 tools/port_map/animal-1.tsv (+4 -4)
📝 tools/port_map/classes-03.tsv (+1 -1)
📝 tools/port_map/classes-04.tsv (+1 -1)

📄 Description

Closes the four MushroomCow gap rows in the port ledger (mobInteract's flower branch, the two save methods and getEffectsFromItemStack). (No issue; from the ledger.)

Vanilla's MushroomCow.mobInteract runs bowl → shears → brown, adult, flower. The bowl gives a suspicious stew carrying the stored SuspiciousStewEffects and then clears them (otherwise plain stew). The flower branch takes the effects from the item's block — SuspiciousEffectHolder.tryGet(item) — and if the cow already holds some it only puffs smoke and does not consume the flower; otherwise it consumes one, stores the entry and plays entity.mooshroom.eat. The effects are saved under stew_effects, nullable.

Horizon had the component (item_data, read back by consume), the brown variant and the bowl, but no flower branch and nowhere to store the effects — entity_nbt said so in a comment — so a bowl always produced plain stew and a flower was placed instead of eaten.

This adds horizon-items/src/flowers.rs with the seventeen flower→effect entries and stew_effect(item) (the tryGet port), the stored effects on the mob, the NBT read/write, the flower branch, and the bowl branch that carries the effects into the minecraft:suspicious_stew stack. The client's own prediction (remote_mob_use) treats a holder flower on a brown mooshroom as taken, so a server client does not go on to place it.

The table is the part worth checking, so here is how it was derived rather than remembered: each block id comes from the BlockItemIds.X reference immediately before that block's constructor in Blocks.<clinit>, mapped through BootstrapMethods to the new FlowerBlock(…) factory; the ticks are floor(seconds * 20); and all seventeen rows match the 26.3 jar's own data/minecraft/recipe/suspicious_stew_from_*.json exactly. Seventeen, not fifteen: WitherRoseBlock and both EyeblossomBlock types extend FlowerBlock, and the eyeblossom values live on EyeblossomBlock.Type (OPEN blindness 11 s, CLOSED nausea 7 s). 26.3's durations differ from 1.21's on eight rows (allium, azure bluet, all four tulips, cornflower, lily, oxeye, wither), which is exactly how a memory-written table goes wrong.

What is proven: on a build box, cargo test -p horizon-items --lib flowers → 1 passed (the full seventeen-row array, every lookup, no duplicates, an unknown item giving none), and cargo test -p horizon-client --lib foxes_mooshrooms → 1 passed with the prepared 26.3 data, covering the stew_effects round-trip and that a cleared list writes no key.

What is not proven: the interaction itself — a brown cow taking a poppy, refusing a second one with smoke, and a bowl giving the right suspicious stew — has no test, because interact_mob is a method on the bin-only Game and the crate has no Mob-plus-stack test shape; a lan_e2e case is the right home and is not written. pr_ready was not run, so CI's verify is the workspace check.

Two approximations, both marked in the code: the particles use the helper's gaussian spread with a scalar speed where 26.3 sends ALTERNATIVE_WITH_SPEED with a per-axis maximum (cosmetic), and the effect is compared by id only — custom potion effects are not part of StackData, which is the same limitation the component itself has.


🔄 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/4515 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/mooshroom-stew` --- ### 📝 Commits (1) - [`87231ee`](https://github.com/horizon-rust/horizon/commit/87231ee654037cc8959c1a853bc84014f34b56d3) Let a brown mooshroom take a flower's stew effects ### 📊 Changes **10 files changed** (+205 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+48 -3) 📝 `crates/horizon-client/src/game/creatures.rs` (+62 -3) 📝 `crates/horizon-client/src/game/remote_mob_use.rs` (+6 -4) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs.rs` (+3 -0) ➕ `crates/horizon-items/src/flowers.rs` (+78 -0) 📝 `crates/horizon-items/src/lib.rs` (+1 -0) 📝 `tools/port_map/animal-1.tsv` (+4 -4) 📝 `tools/port_map/classes-03.tsv` (+1 -1) 📝 `tools/port_map/classes-04.tsv` (+1 -1) </details> ### 📄 Description Closes the four `MushroomCow` gap rows in the port ledger (`mobInteract`'s flower branch, the two save methods and `getEffectsFromItemStack`). (No issue; from the ledger.) Vanilla's `MushroomCow.mobInteract` runs bowl → shears → **brown, adult, flower**. The bowl gives a suspicious stew carrying the stored `SuspiciousStewEffects` and then clears them (otherwise plain stew). The flower branch takes the effects from the **item's block** — `SuspiciousEffectHolder.tryGet(item)` — and if the cow already holds some it only puffs smoke and does **not** consume the flower; otherwise it consumes one, stores the entry and plays `entity.mooshroom.eat`. The effects are saved under `stew_effects`, nullable. Horizon had the component (`item_data`, read back by `consume`), the brown variant and the bowl, but no flower branch and nowhere to store the effects — `entity_nbt` said so in a comment — so a bowl always produced plain stew and a flower was placed instead of eaten. This adds `horizon-items/src/flowers.rs` with the seventeen flower→effect entries and `stew_effect(item)` (the `tryGet` port), the stored effects on the mob, the NBT read/write, the flower branch, and the bowl branch that carries the effects into the `minecraft:suspicious_stew` stack. The client's own prediction (`remote_mob_use`) treats a holder flower on a brown mooshroom as taken, so a server client does not go on to place it. **The table is the part worth checking**, so here is how it was derived rather than remembered: each block id comes from the `BlockItemIds.X` reference immediately before that block's constructor in `Blocks.<clinit>`, mapped through `BootstrapMethods` to the `new FlowerBlock(…)` factory; the ticks are `floor(seconds * 20)`; and all seventeen rows **match the 26.3 jar's own `data/minecraft/recipe/suspicious_stew_from_*.json` exactly**. Seventeen, not fifteen: `WitherRoseBlock` and both `EyeblossomBlock` types extend `FlowerBlock`, and the eyeblossom values live on `EyeblossomBlock.Type` (OPEN blindness 11 s, CLOSED nausea 7 s). 26.3's durations differ from 1.21's on eight rows (allium, azure bluet, all four tulips, cornflower, lily, oxeye, wither), which is exactly how a memory-written table goes wrong. **What is proven:** on a build box, `cargo test -p horizon-items --lib flowers` → 1 passed (the full seventeen-row array, every lookup, no duplicates, an unknown item giving none), and `cargo test -p horizon-client --lib foxes_mooshrooms` → 1 passed with the prepared 26.3 data, covering the `stew_effects` round-trip and that a cleared list writes no key. **What is not proven:** the interaction itself — a brown cow taking a poppy, refusing a second one with smoke, and a bowl giving the right suspicious stew — has no test, because `interact_mob` is a method on the bin-only `Game` and the crate has no `Mob`-plus-stack test shape; a `lan_e2e` case is the right home and is not written. `pr_ready` was not run, so CI's `verify` is the workspace check. Two approximations, both marked in the code: the particles use the helper's gaussian spread with a scalar speed where 26.3 sends `ALTERNATIVE_WITH_SPEED` with a per-axis maximum (cosmetic), and the effect is compared by id only — custom potion effects are not part of `StackData`, which is the same limitation the component itself has. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:11 +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#5666
No description provided.