basic chunk gen

pull/7/head
valoeghese 2020-02-25 21:29:08 +13:00
parent 94df8803ca
commit ea023b3374
1 changed files with 14 additions and 0 deletions

View File

@ -77,6 +77,20 @@ public class Chunk implements TileAccess
} }
} }
public static Chunk generateChunk(int chunkX, int chunkY, int chunkZ) {
Chunk result = new Chunk(chunkX, chunkY, chunkZ);
for (int x = 0; x < 7; ++x) {
for (int z = 0; z < 7; ++z) {
for (int y = 0; y < 7; ++y) {
result.setBlock(x, y, z, y == 7 ? Block.GRASS : Block.DIRT);
}
}
}
return result;
}
public void setRender(boolean render) public void setRender(boolean render)
{ {
if (render && !this.render) // if it has been changed to true if (render && !this.render) // if it has been changed to true