use of team.cqr.cqrepoured.world.structure.generation.generation.part.IDungeonPart in project ChocolateQuestRepoured by TeamChocoQuest.
the class GeneratableDungeon method tryGeneratePart.
private void tryGeneratePart(World world) {
long t = System.nanoTime();
for (IDungeonPart part : this.parts) {
part.generate(world, this);
}
for (ChunkInfo chunkInfo : this.chunkInfoMap.values()) {
Chunk chunk = world.getChunk(chunkInfo.getChunkX(), chunkInfo.getChunkZ());
if (world.provider.hasSkyLight()) {
for (int chunkY = chunkInfo.topMarked(); chunkY >= 0; chunkY--) {
ChunkSection blockStorage = chunk.getSections()[chunkY];
if (blockStorage == Chunk.EMPTY_SECTION) {
blockStorage = new ChunkSection(chunkY << 4);
chunk.getSections()[chunkY] = blockStorage;
}
Arrays.fill(blockStorage.getSkyLight().getData(), (byte) 0);
}
}
chunkInfo.forEach(chunkY -> {
ChunkSection blockStorage = chunk.getSections()[chunkY];
if (blockStorage != Chunk.EMPTY_SECTION) {
Arrays.fill(blockStorage.getBlockLight().getData(), (byte) 0);
}
int r = 1;
for (int x = -r; x <= r; x++) {
for (int y = -r; y <= r; y++) {
for (int z = -r; z <= r; z++) {
this.chunkInfoMapExtended.mark(chunkInfo.getChunkX() + x, chunkY + y, chunkInfo.getChunkZ() + z);
}
}
}
});
}
this.generationTimes[1] += System.nanoTime() - t;
}
Aggregations