diff --git a/src/main/java/ru/betterend/world/features/RoundCaveFeature.java b/src/main/java/ru/betterend/world/features/RoundCaveFeature.java index 2783a09c..a54e63d1 100644 --- a/src/main/java/ru/betterend/world/features/RoundCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/RoundCaveFeature.java @@ -31,6 +31,8 @@ import ru.betterend.util.sdf.primitive.SDFHexPrism; import ru.betterend.util.sdf.primitive.SDFSphere; public class RoundCaveFeature extends DefaultFeature { + private static final BlockState CAVE_AIR = Blocks.CAVE_AIR.getDefaultState(); + @Override public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) { if (pos.getX() * pos.getX() + pos.getZ() * pos.getZ() <= 22500) { @@ -48,7 +50,7 @@ public class RoundCaveFeature extends DefaultFeature { while (top > bottom && !world.getBlockState(bpos).isIn(EndTags.GEN_TERRAIN)) { bpos.setY(--top); } - top -= radius + 5; + top -= radius * 1.3F + 5; if (top <= bottom) { return false; @@ -89,17 +91,17 @@ public class RoundCaveFeature extends DefaultFeature { if (dist < r * r) { BlockState state = world.getBlockState(bpos); if (isReplaceable(state)) { - BlocksHelper.setWithoutUpdate(world, bpos, AIR); + BlocksHelper.setWithoutUpdate(world, bpos, CAVE_AIR); while (state.getMaterial().equals(Material.LEAVES)) { - BlocksHelper.setWithoutUpdate(world, bpos, AIR); + BlocksHelper.setWithoutUpdate(world, bpos, CAVE_AIR); bpos.setY(bpos.getY() + 1); state = world.getBlockState(bpos); } bpos.setY(y - 1); while (state.getMaterial().equals(Material.LEAVES)) { - BlocksHelper.setWithoutUpdate(world, bpos, AIR); + BlocksHelper.setWithoutUpdate(world, bpos, CAVE_AIR); bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } diff --git a/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java index d3c29507..73958f31 100644 --- a/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java @@ -94,6 +94,7 @@ public class MountainPiece extends BasePiece { Mutable pos = new Mutable(); Chunk chunk = world.getChunk(chunkPos.x, chunkPos.z); Heightmap map = chunk.getHeightmap(Type.WORLD_SURFACE); + Heightmap map2 = chunk.getHeightmap(Type.WORLD_SURFACE_WG); for (int x = 0; x < 16; x++) { int px = x + sx; int px2 = px - center.getX(); @@ -112,10 +113,11 @@ public class MountainPiece extends BasePiece { continue; } pos.setY(minY); - while (!chunk.getBlockState(pos).isIn(EndTags.GEN_TERRAIN) && pos.getY() > 56) { + while (!chunk.getBlockState(pos).isIn(EndTags.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.down()).isOf(Blocks.CAVE_AIR)) { pos.setY(pos.getY() - 1); } minY = pos.getY(); + minY = Math.max(minY, map2.get(x, z)); if (minY > 10) { float maxY = dist * height * getHeightClamp(world, 8, px, pz); if (maxY > 0) {