[PR #4551] [MERGED] Foxes screech at night when no player is near #5690

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

📋 Pull Request Information

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

Base: main ← Head: fox-night-screech


📝 Commits (1)

  • c094313 Foxes screech at night when no player is near (#4533)

📊 Changes

2 files changed (+157 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+137 -0)
📝 crates/horizon-client/src/mobs/fox.rs (+20 -0)

📄 Description

🤖 Opened by foudretbr's AI agent (Claude Code, Claude Opus 5.5), not by foudretbr personally.

Closes #4533. The Fox.playAmbientSound row of #3512.

Foxes now screech at night. Before, an awake fox's ambient sound was always entity.fox.ambient.

Vanilla followed (26.3)

  • Fox.getAmbientSound: past the sleeping case, when !Level.isBrightOutside() and random.nextFloat() < 0.1F, FOX_SCREECH if no non-spectator player's box is within getBoundingBox().inflate(16.0); else FOX_AMBIENT.
  • Fox.playAmbientSound: the screech at volume 2.0 with getVoicePitch(); otherwise Mob.playAmbientSound → makeSound(getAmbientSound()), a second call (and a second draw, which can itself pick the screech, then played at getSoundVolume() 1.0).
  • Level.isBrightOutside: !hasFixedTime() && skyDarken < 4, as w.daylight && !w.end (the same reading as enderman.rs).

Changes

  • mobs/fox.rs: awake_ambient (Fox.getAmbientSound for an awake fox) and SCREECH.
  • mobs/ai.rs play_ambient: the Fox arm for Fox.playAmbientSound, and a unit test (fox_screech_tests): night alone, day, the End, a player at the 16-block edge and past it, a spectator.

Note

The player test uses MobWorld.player, the one player mobs see, as every other mob check does. On a server with several players, the screech check only looks at that player (the one lan_mobs::choose picks), not every player in the box.

Self-check

Run on Windows: the two failures are Windows-only and outside this change. title::tests::each_world_preset_writes_its_own_generator makes a directory named minecraft:normal (: is not allowed in Windows paths). tools/parity.py imports fcntl, which Windows doesn't have, so the harnesses didn't run here: CI's parity job runs them.

pr_ready (tools/pr_ready.py --base upstream/main on Nissan-Skyline-GT-R, against upstream/main at c9f49f3b5, 10 min 43 s)

Check Result
Scope ✅ 2 files, +156 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (1 min 7 s)
rustfmt ✅ (10 s)
clippy ✅ (2 min 35 s)
tests: horizon-client ❌ 790 passed, 1 failed (6 min 32 s)
doc tests ✅ 0 passed (14 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 365 affected, (2 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/4551 **Author:** [@foudretbr](https://github.com/foudretbr) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fox-night-screech` --- ### 📝 Commits (1) - [`c094313`](https://github.com/horizon-rust/horizon/commit/c094313726298532961bc892353a511830232123) Foxes screech at night when no player is near (#4533) ### 📊 Changes **2 files changed** (+157 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+137 -0) 📝 `crates/horizon-client/src/mobs/fox.rs` (+20 -0) </details> ### 📄 Description > 🤖 Opened by foudretbr's AI agent (Claude Code, Claude Opus 5.5), not by foudretbr personally. Closes #4533. The `Fox.playAmbientSound` row of #3512. Foxes now screech at night. Before, an awake fox's ambient sound was always `entity.fox.ambient`. ### Vanilla followed (26.3) - `Fox.getAmbientSound`: past the sleeping case, when `!Level.isBrightOutside()` and `random.nextFloat() < 0.1F`, `FOX_SCREECH` if no non-spectator player's box is within `getBoundingBox().inflate(16.0)`; else `FOX_AMBIENT`. - `Fox.playAmbientSound`: the screech at volume 2.0 with `getVoicePitch()`; otherwise `Mob.playAmbientSound` → `makeSound(getAmbientSound())`, a second call (and a second draw, which can itself pick the screech, then played at `getSoundVolume()` 1.0). - `Level.isBrightOutside`: `!hasFixedTime() && skyDarken < 4`, as `w.daylight && !w.end` (the same reading as `enderman.rs`). ### Changes - `mobs/fox.rs`: `awake_ambient` (`Fox.getAmbientSound` for an awake fox) and `SCREECH`. - `mobs/ai.rs` `play_ambient`: the Fox arm for `Fox.playAmbientSound`, and a unit test (`fox_screech_tests`): night alone, day, the End, a player at the 16-block edge and past it, a spectator. ### Note The player test uses `MobWorld.player`, the one player mobs see, as every other mob check does. On a server with several players, the screech check only looks at that player (the one `lan_mobs::choose` picks), not every player in the box. ### Self-check Run on Windows: the two failures are Windows-only and outside this change. `title::tests::each_world_preset_writes_its_own_generator` makes a directory named `minecraft:normal` (`:` is not allowed in Windows paths). `tools/parity.py` imports `fcntl`, which Windows doesn't have, so the harnesses didn't run here: CI's parity job runs them. **pr_ready** (`tools/pr_ready.py --base upstream/main` on Nissan-Skyline-GT-R, against upstream/main at c9f49f3b5, 10 min 43 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +156 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (1 min 7 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (2 min 35 s) | | tests: horizon-client | ❌ 790 passed, 1 failed (6 min 32 s) | | doc tests | ✅ 0 passed (14 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 365 affected, (2 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:21 +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#5690
No description provided.