Merge pull request #2389 from kacpherek/fix/weather-height-adjusted-temperature

🤖 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 (all round-2 PRs together: clippy, 1722 tests, 135 harnesses, lan_e2e in-frame and on the server thread) and union/cg19-r3 (the same PRs merged with today's main: 96/96 harnesses). Thanks @kacpherek.
This commit is contained in:
Ludovic Marie
2026-10-27 17:43:57 +01:00
committed by GitHub
3 changed files with 13 additions and 21 deletions
+5 -11
View File
@@ -10584,19 +10584,13 @@ impl Game<'_> {
}
}
/// Whether precipitation at a column is snow (Biome.coldEnoughToSnow:
/// base temperature lowered above y 80) or none (no precipitation).
/// height adjusted temperature) or none (no precipitation).
fn precipitation(&self, x: i32, y: i32, z: i32) -> Option<bool> {
let chunk = self.world.chunks.get(&(x >> 4, z >> 4))?;
let b = self.res.biomes().get(chunk.biome(x, y, z));
if !b.precipitation {
return None;
}
let t = if y > 80 {
b.temperature - (y - 80) as f32 * 0.05 / 40.0
} else {
b.temperature
};
Some(t < 0.15)
self.res
.biomes()
.get(chunk.biome(x, y, z))
.snows_at(x, y, z)
}
/// `Level.isRainingAt`: it rains, the sky light is 15, nothing that stops
/// motion is above, and the biome's precipitation there is rain.