Merge pull request #2520 from kacpherek/fix/mob-step-sounds

🤖 Agent: Merged by Ludovic's AI agent (Claude, contrib-gate-19). Thanks @kacpherek: Fix turtle step timing and camel sand step sounds. I checked it against vanilla 26.3, and it passed every harness it reaches in a union with your other PRs, plus lan_e2e in both modes.
This commit is contained in:
Ludovic Marie
2026-10-27 09:23:01 +01:00
committed by GitHub
2 changed files with 17 additions and 3 deletions
+14 -2
View File
@@ -1701,8 +1701,20 @@ pub fn step_sound(
S::Husk => quiet("entity.husk.step"),
S::Drowned => quiet("entity.drowned.step"),
S::ZombieVillager => quiet("entity.zombie_villager.step"),
S::CamelHusk => Some(("entity.camel_husk.step", 0.4, 1.0)),
S::Camel => Some(("entity.camel.step", 1.0, 1.0)),
// Camel.playStepSound and CamelHusk.playStepSound: sand and concrete
// powder have their own step.
S::CamelHusk | S::Camel => {
let sand = w.has_tag(
"minecraft:camel_sand_step_sound_blocks",
&w.facts.get(state).name,
);
Some(match (m.species(), sand) {
(S::Camel, true) => ("entity.camel.step_sand", 1.0, 1.0),
(S::Camel, false) => ("entity.camel.step", 1.0, 1.0),
(_, true) => ("entity.camel_husk.step_sand", 0.4, 1.0),
(_, false) => ("entity.camel_husk.step", 0.4, 1.0),
})
}
S::IronGolem => Some(("entity.iron_golem.step", 1.0, 1.0)),
// CopperGolem.playStepSound: its oxidation level's step.
S::CopperGolem => Some((super::copper_golem::sound(m, "step"), 1.0, 1.0)),
+3 -1
View File
@@ -549,13 +549,15 @@ impl Mob {
}
}
/// `Entity.nextStep`: the next whole metre walked; a warden's steps come
/// every 0.55, a strider's every 0.6.
/// every 0.55, a strider's every 0.6, a turtle's every 0.15.
fn next_step(&self) -> f32 {
let walked = self.ai.steps.move_dist;
if self.kind.species == super::Species::Warden {
walked + 0.55
} else if self.kind.species == super::Species::Strider {
walked + 0.6
} else if self.kind.species == super::Species::Turtle {
walked + 0.15
} else {
(walked as i32).wrapping_add(1) as f32
}