Fish: the window tracks the fluid contact of the mobs it only displays

`m.fluids` is filled by `Mob::update_fluids`, which only runs in the mob tick
on the server. A window that is a client of a server never runs that tick, so
every mob it draws kept the default `Fluids { in_water: false }` for its whole
life. Cod, salmon and tropical fish rotate onto their side while `!in_water`
(`mobs/aquatic.rs`), so they were drawn lying on their flank in water, while
their position and heading, which come from the server, looked correct (#1591).

`tick_remote_entities` now runs vanilla's `EntityFluidInteraction.update` for
the displayed mobs before it ticks their animations, so the renderers read the
water contact the same way they do for a mob the window simulates itself.

Fixes #1591.

Co-Authored-By: Hermes Agent (Nous Research) <noreply@nousresearch.com>
This commit is contained in:
Alexander Krylov
2026-10-24 23:01:31 +03:00
parent fe128948ba
commit 508cb2df9f
+13
View File
@@ -3325,6 +3325,19 @@ impl Game<'_> {
/// ClientLevel.tickEntities; a frozen level only ticks the players
/// (`TickRateManager.isEntityFrozen`).
fn tick_remote_entities(&mut self, running: bool) {
// EntityFluidInteraction.update for the entities this window only displays: the
// server never sends the fluid contact, and the renderers read it (cod, salmon and
// tropical fish lie on their side without `in_water`, #1591).
let fluids: Vec<_> = {
let w = self.mob_world_base(&[]);
self.mobs
.iter()
.map(|m| w.fluids(m.bounds(), m.eye_y()))
.collect()
};
for (m, fluids) in self.mobs.iter_mut().zip(fluids) {
m.fluids = fluids;
}
let Some(r) = self.remote.as_mut() else {
return;
};