@Override
protected void generateActualBlocks(WorldGenerator generator, PlatMap platmap, RealChunk chunk, DataContext context, int platX, int platZ) {
// check out the neighbors
//SurroundingFloors neighborBasements = getNeighboringBasementCounts(platmap, platX, platZ);
SurroundingFloors neighborFloors = getNeighboringFloorCounts(platmap, platX, platZ);
// is rounding allowed and where are the stairs
boolean allowRounded = rounded &&
insetWallWE == insetWallNS &&
insetCeilingWE == insetCeilingNS &&
neighborFloors.isRoundable();
StairWell stairLocation = getStairWellLocation(allowRounded, neighborFloors);
if (!needStairsUp)
stairLocation = StairWell.NONE;
// work on the basement stairs first
for (int floor = 0; floor < depth; floor++) {
int floorAt = generator.streetLevel - basementFloorHeight * floor - 2;
// stairs?
if (needStairsDown) {
// top is special... but only if there are no stairs up
if (floor == 0 && !needStairsUp) {
drawStairsWalls(generator, chunk, floorAt,
basementFloorHeight, stairLocation, stairWallMaterial, true, false);
// all the rest of those lovely stairs
} else {
// plain walls please
drawStairsWalls(generator, chunk, floorAt, basementFloorHeight,
stairLocation, wallMaterial, false, floor == depth - 1);
// place the stairs and such
drawStairs(generator, chunk, floorAt, basementFloorHeight,
stairLocation, stairMaterial, stairPlatformMaterial);
// pillars if no stairs here
drawOtherPillars(chunk, floorAt, basementFloorHeight,
stairLocation, wallMaterial);
}
// if no stairs then
} else {
drawOtherPillars(chunk, floorAt, basementFloorHeight,
StairWell.CENTER, wallMaterial);
}
}
// insetting the inset
int localInsetWallWE = insetWallWE;
int localInsetWallNS = insetWallNS;
// now the above ground floors
aboveFloorHeight = firstFloorHeight;
for (int floor = 0; floor < height; floor++) {
int floorAt = generator.streetLevel + aboveFloorHeight * floor + 2;
// allowRounded = allowRounded && neighborFloors.isRoundable();
// stairLocation = getStairWellLocation(allowRounded, neighborFloors);
// if (!needStairsUp || floor == height - 1)
// stairLocation = StairWell.NONE;
// breath in?
if (insetInsetted) {
if (floor == insetInsetMidAt || floor == insetInsetHighAt) {
localInsetWallWE++;
localInsetWallNS++;
}
}
// inside walls
drawInteriorParts(generator, chunk, context,
roomProviderForFloor(generator, chunk, floor, floorAt), floor, floorAt,
aboveFloorHeight - 1, localInsetWallNS, localInsetWallWE,
allowRounded, wallMaterial, glassMaterial,
stairLocation, stairMaterial, stairWallMaterial, stairPlatformMaterial,
needStairsUp && (floor > 0 || (floor == 0 && (depth > 0 || height > 1))),
needStairsUp && (floor < height - 1),
floor == height - 1, floor == 0 && depth == 0,
neighborFloors);
// // stairs?
// if (needStairsUp) {
//
// // fancy walls... maybe
// if (floor > 0 || (floor == 0 && (depth > 0 || height > 1))) {
// drawStairsWalls(chunk, floorAt, aboveFloorHeight, stairLocation,
// stairWallMaterial, floor == height - 1, floor == 0 && depth == 0);
// }
//
// // more stairs and such
// if (floor < height - 1)
// drawStairs(chunk, floorAt, aboveFloorHeight, stairLocation,
// stairMaterial, stairPlatformMaterial);
// }
// one down, more to go
neighborFloors.decrement();
aboveFloorHeight = otherFloorHeight;
}
// happy place?
if (!generator.settings.includeDecayedBuildings) {