starandserpent / java-TerraServer

Terra - Voxel octree of chunks, made for Rituals of the old
MIT License
17 stars 2 forks source link

Empty blocks not being generated properly #35

Closed Pilvinen closed 5 years ago

Pilvinen commented 5 years ago

Test generator code:

    public void generate(GenerationTask task, GeneratorControl control, Void nothing) {
        BlockBuffer buf = control.getBuffer();

        if (task.getY() < 0) {
            for (int i = 0; i < DataConstants.CHUNK_MAX_BLOCKS; i++) {
                if (i == 1) {
                    buf.write(grass);
                } else {
                    buf.write(grass);
                }
                if (buf.hasNext()) {
                    buf.next();
                }
            }
        }
    }

Expected result:

Mostly empty space with some grass blocks.

What actually happens:

Everything is grass.

Possible cause:

Should look into Palette16ChunkFormat

Pilvinen commented 5 years ago

Added default id 0 (air). Has been fixed on generate branch.