Skip to content

Commit

Permalink
Clean + else if
Browse files Browse the repository at this point in the history
  • Loading branch information
strubium authored May 10, 2024
1 parent 76299bd commit 6ddb028
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ private void generateHighwayPart(BuildingInfo info,
// Simple highway in the city
Random random = new Random();
String partKey = random.nextDouble() < 0.9 ? "highway_open" : "highway_open_crossing";
part = AssetRegistries.PARTS.get(partKey + suffix);
part = AssetRegistries.PARTS.get(partKey + suffix);
int height = generatePart(info, part, transform, 0, highwayGroundLevel, 0, true,
true, runningX, intersects,
Expand Down Expand Up @@ -2437,19 +2436,20 @@ private void generateBuilding(BuildingInfo info, ChunkHeightmap heightmap) {
driver.add(palette.get(borderBlock));
y++;
}
} else if (info.profile.isDefault()) {
}
else if (info.profile.isDefault()) {
driver.setBlockRange(x, info.profile.BEDROCK_LAYER, z, lowestLevel, baseChar);
}
else if (info.profile.isCavern()) {
// Also clear the inside of buildings to avoid geometry that doesn't really belong there
clearRange(info, x, z, lowestLevel, info.getCityGroundLevel() + info.getNumFloors() * 6, info.waterLevel > info.groundLevel);
}
if (driver.getBlock(x, lowestLevel, z) == airChar) {
char filler = palette.get(fillerBlock);
driver.current(x, lowestLevel, z).block(filler); // There is nothing below so we fill this with the filler
}

if (info.profile.isCavern()) {
// Also clear the inside of buildings to avoid geometry that doesn't really belong there
// clearRange(primer, index, lowestLevel, info.getCityGroundLevel() + info.getNumFloors() * 6, waterLevel > mainGroundLevel);
clearRange(info, x, z, lowestLevel, info.getCityGroundLevel() + info.getNumFloors() * 6, info.waterLevel > info.groundLevel);
}

}
}
}
Expand Down Expand Up @@ -2668,7 +2668,6 @@ private boolean hasConnectionToTopOrOutside(int localLevel, BuildingInfo info, B
return false;
}
return (info2.isCity && !info2.hasBuilding && localLevel == 0 && localAdjacent == 0) || (info2.hasBuilding && localAdjacent == info2.getNumFloors());
// return (!info2.hasBuilding && localLevel == localAdjacent) || (info2.hasBuilding && localAdjacent == info2.getNumFloors());
}

private boolean hasConnectionWithBuilding(int localLevel, BuildingInfo info, BuildingInfo info2) {
Expand Down

0 comments on commit 6ddb028

Please sign in to comment.