Compare commits

...
2 changed files with 16 additions and 0 deletions

No files matched your search

+6
View File
@@ -559,6 +559,12 @@ impl ChunkEncoder {
bits
}
/// DEBUG #4294: the highest non-air section.
pub fn debug_top(&self, chunk: &Chunk) -> Option<usize> {
let bits = self.occupied(chunk);
(0..64).rev().find(|&i| bits.contains(i))
}
/// The non-air sections of the column and its neighbours, as bits.
fn around(&self, chunk: &Chunk, world: &crate::world::World) -> SectionMask {
let mut around = SectionMask::EMPTY;
+10
View File
@@ -1437,6 +1437,16 @@ impl Hub {
})
.collect();
self.encoder.warm(&columns);
for c in &columns {
let around: Vec<String> = (-1..=1)
.flat_map(|dz| (-1..=1).map(move |dx| (dx, dz)))
.map(|(dx, dz)| match world.chunks.get(&(c.x + dx, c.z + dz)) {
Some(n) => format!("{dx},{dz}:{:?}{}", self.encoder.debug_top(n), if n.lit { "" } else { "u" }),
None => format!("{dx},{dz}:-"),
})
.collect();
eprintln!("LLDEBUG tick {} send {},{} {}", self.ticks, c.x, c.z, around.join(" "));
}
let mut bodies: Vec<Vec<u8>> = columns
.iter()
.map(|c| self.encoder.body_in(c, world))