WIP snapshot: unfinished net parity work (paused mid-task, may not build)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-08 21:39:59 +02:00
parent dd86e16da2
commit bb0ae764f9
3 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -1321,8 +1321,8 @@ impl Game<'_> {
let at = [f64::from(pos[0]) + 0.5, f64::from(pos[1]) + 0.5, f64::from(pos[2]) + 0.5];
self.audio.play(&s.break_sound, Some(at), (s.volume + 1.0) / 2.0, s.pitch * 0.8);
self.destroy_particles(pos, state);
let fluid = self.res.facts.get(state).waterlogged;
let air = if fluid { self.world.air } else { self.world.air };
// The server's block update follows (waterlogged blocks leave water).
let air = self.world.air;
if self.world.set(pos[0], pos[1], pos[2], air).is_ok() {
self.world.block_entities.remove(&(pos[0], pos[1], pos[2]));
}
@@ -1645,7 +1645,7 @@ impl Game<'_> {
}
if let Some(input) = &r.chat_input {
batch.fill(atlas, 2.0, h - 14.0, w - 4.0, 12.0, rgba(0, 0, 0, 128));
let blink = (self.started.elapsed().as_millis() / 300) % 2 == 0;
let blink = (self.started.elapsed().as_millis() / 300).is_multiple_of(2);
let shown = if blink { format!("{input}_") } else { input.clone() };
batch.text(atlas, &shown, 4.0, h - 12.0, rgba(224, 224, 224, 255), true);
}
+1 -1
View File
@@ -158,7 +158,7 @@ impl Title {
batch.text(atlas, &shown, w / 2.0 - 96.0, y + 17.0, rgba(224, 224, 224, 255), true);
}
}
Mode::Multiplayer(screen) => screen.draw(atlas, batch, (self.started.elapsed().as_millis() / 300) % 2 == 0),
Mode::Multiplayer(screen) => screen.draw(atlas, batch, (self.started.elapsed().as_millis() / 300).is_multiple_of(2)),
}
for b in self.buttons(w, h) {
let hover = b.enabled && cursor.0 >= b.x && cursor.0 < b.x + b.w && cursor.1 >= b.y && cursor.1 < b.y + 20.0;
+3 -1
View File
@@ -253,7 +253,7 @@ packet!(
impl LightData {
/// Per light section: the sky and block DataLayers (None = absent/unchanged,
/// Some(zeroed) when marked empty).
pub fn layers(&self, light_sections: usize) -> Vec<(Option<Vec<u8>>, Option<Vec<u8>>)> {
pub fn layers(&self, light_sections: usize) -> Vec<SectionLight> {
use crate::buf::bit;
let (mut sky, mut block) = (self.sky.iter(), self.block.iter());
(0..light_sections)
@@ -277,6 +277,8 @@ impl LightData {
.collect()
}
}
/// A light section's (sky, block) DataLayers.
pub type SectionLight = (Option<Vec<u8>>, Option<Vec<u8>>);
/// DataLayer.get: the nibble at (y << 8 | z << 4 | x), low nibble first.
pub fn nibble(layer: &[u8], i: usize) -> u8 {
layer