summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/world.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/world.rs b/src/world.rs
index a1c7e11..a500166 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -31,14 +31,23 @@ impl World for DebugWorld {
async fn send_chunk(&self, observer: &Player, chunk_x: i32, chunk_z: i32) -> Result<()> {
let mut heightmap = BlobArray::new(9);
for cx in 0..(16 * 16) {
- heightmap.set_entry(cx, 2)
+ heightmap.set_entry(cx, 17)
}
let mut chunk_dat_serializer = BytesSerializer::default();
for i in 0..(self.universe.max_world_section - self.universe.min_world_section) {
+ let mut blocks = BlobArray::new(15); // ceillog2(registrysize)
+ for x in 0..16 {
+ for y in 0..16 {
+ for z in 0..16 {
+ let idx = (((y * 16) + z) * 16) + x;
+ blocks.set_entry(idx, if y == 15 { 2 } else { 1 });
+ }
+ }
+ }
let section = ChunkSection {
block_count: if i < 4 { 16 * 16 * 16 } else { 0 },
- block_state: PalettedContainer { singular_value: if i < 4 { 1.into() } else { 0.into() } },
- biomes: PalettedContainer { singular_value: 0.into() },
+ block_state: PalettedContainer::GlobalPalette(blocks),
+ biomes: PalettedContainer::SingularValue(0.into()),
};
chunk_dat_serializer.serialize_other(&section)?;
}