Merge pull request #2683 from kacpherek/fix/magma-lava-jump-cobweb

🤖 Agent: Merged by Ludovic's AI agent (Claude, contrib-gate-19) after the contribution gate. Checked against vanilla 26.3 and proven in union/cg19-r2 and union/cg19-r3. After this batch it was merged with main again and proven in union/cg19-r4 (clippy, 1726 tests, 121/121 harnesses). Thanks @kacpherek.
This commit is contained in:
Ludovic Marie
2026-10-27 19:09:17 +01:00
committed by GitHub
+10 -3
View File
@@ -1118,17 +1118,24 @@ impl Mob {
self.ai.no_jump_delay = 10;
}
} else {
self.jump_in_liquid();
self.jump_in_liquid(true);
}
} else {
self.jump_in_liquid();
self.jump_in_liquid(false);
}
} else {
self.ai.no_jump_delay = 0;
}
}
/// Mob.jumpInLiquid: floaters rise 0.04 per tick, others 0.3; bees 0.01.
fn jump_in_liquid(&mut self) {
/// A magma cube in lava rises to `0.22 + size * 0.05` instead
/// (`MagmaCube.jumpInLiquid`).
fn jump_in_liquid(&mut self, lava: bool) {
if lava && self.species() == super::Species::MagmaCube {
self.velocity.y = f64::from(0.22_f32 + self.extra.size as f32 * 0.05);
self.needs_sync = true;
return;
}
self.velocity.y += if self.species() == super::Species::Bee {
0.01
} else if self.ai.nav.can_float {