blob: 7b23645471e2ef356b0dbcd33d97a0cd489517fa [file] [log] [blame] [raw]
package net.glowstone.world;
import net.glowstone.GlowChunk;
import net.glowstone.GlowWorld;
/**
* A {@link WorldGenerator} used to generate a test world.
* @author Graham Edgecombe
*/
public final class TestWorldGenerator implements WorldGenerator {
@Override
public GlowChunk generate(GlowWorld world, int chunkX, int chunkZ) {
GlowChunk chunk = new GlowChunk(world, chunkX, chunkZ);
for (int x = 0; x < GlowChunk.WIDTH; x++) {
for (int z = 0; z < GlowChunk.HEIGHT; z++) {
for (int y = 0; y < GlowChunk.DEPTH; y++) {
int id = 0;
if (y == 60)
id = 2;
else if (y >= 55 && y < 60)
id = 3;
else if (y < 55)
id = 1;
chunk.setType(x, z, y, id);
chunk.setMetaData(x, z, y, 0);
chunk.setBlockLight(x, z, y, 0);
chunk.setSkyLight(x, z, y, 15);
}
}
}
return chunk;
}
}