better base flattening
This commit is contained in:
parent
2805ccd9ad
commit
24fad18bec
@ -114,10 +114,10 @@ public class TerrainHelper {
|
|||||||
int level = pieceBounds.minY + piece.getGroundLevelDelta();
|
int level = pieceBounds.minY + piece.getGroundLevelDelta();
|
||||||
if (level > y) {
|
if (level > y) {
|
||||||
y = raise(pieceBounds, pos.setPos(x, surface, z), level, y, borderRadius);
|
y = raise(pieceBounds, pos.setPos(x, surface, z), level, y, borderRadius);
|
||||||
} else if (level < surface && pieceBounds.getYSize() > 4) {
|
}
|
||||||
if (highest == null) {
|
|
||||||
highest = piece;
|
if (x > pieceBounds.minX && x < pieceBounds.maxX && z > pieceBounds.minZ && z < pieceBounds.maxZ) {
|
||||||
} else if (highest.getBoundingBox().maxY < pieceBounds.maxY) {
|
if (highest == null || pieceBounds.minY > highest.getBoundingBox().minY) {
|
||||||
highest = piece;
|
highest = piece;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,10 +134,9 @@ public class TerrainHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highest != null && highest.getBoundingBox().minY < surface) {
|
if (highest != null) {
|
||||||
MutableBoundingBox bounds = highest.getBoundingBox();
|
MutableBoundingBox bounds = highest.getBoundingBox();
|
||||||
if (x > bounds.minX && x < bounds.maxX && z > bounds.minZ && z < bounds.maxZ) {
|
for (int dy = bounds.minY + highest.getGroundLevelDelta(); dy <= surface; dy++) {
|
||||||
for (int dy = bounds.minY + 1; dy <= surface; dy++) {
|
|
||||||
pos.setPos(dx, dy, dz);
|
pos.setPos(dx, dy, dz);
|
||||||
chunk.setBlockState(pos, Blocks.AIR.getDefaultState(), false);
|
chunk.setBlockState(pos, Blocks.AIR.getDefaultState(), false);
|
||||||
}
|
}
|
||||||
@ -145,7 +144,6 @@ public class TerrainHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private float raise(MutableBoundingBox bounds, BlockPos.Mutable pos, float level, float surface, int borderRadius) {
|
private float raise(MutableBoundingBox bounds, BlockPos.Mutable pos, float level, float surface, int borderRadius) {
|
||||||
float radius2 = Math.max(1, borderRadius * borderRadius);
|
float radius2 = Math.max(1, borderRadius * borderRadius);
|
||||||
|
Loading…
Reference in New Issue
Block a user