public void create(int chunkNumX, int chunkNumY, int chunkNumZ, int chunkSize) { curStartChunkX = curStartChunkY = curStartChunkZ = -65536; sizeX = chunkNumX; sizeY = chunkNumY; sizeZ = chunkNumZ; this.chunkSize = chunkSize; chunks = new RayTraceChunk[sizeX, sizeY, sizeZ]; for (int k = 0; k < sizeZ; k++) { for (int j = 0; j < sizeY; j++) { for (int i = 0; i < sizeX; i++) { RayTraceChunk temp = new RayTraceChunk(); temp.create(chunkSize, chunkSize, chunkSize); temp.clearAll(); chunks[i, j, k] = temp; } } } }