Fix turtle step timing and camel sand step sounds

This commit is contained in:
Kacpherek
2026-10-26 22:43:50 +01:00
parent 4504223265
commit dca96dd1df
2 changed files with 17 additions and 3 deletions
+14 -2
View File
@@ -1591,8 +1591,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
@@ -529,13 +529,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
}