End cave exit fixes
This commit is contained in:
parent
3d79aa6050
commit
590e8d0096
1 changed files with 10 additions and 5 deletions
|
@ -88,12 +88,16 @@ public class TunelCaveFeature extends EndCaveFeature {
|
||||||
Set<BlockPos> floorPositions = Sets.newHashSet();
|
Set<BlockPos> floorPositions = Sets.newHashSet();
|
||||||
Set<BlockPos> ceilPositions = Sets.newHashSet();
|
Set<BlockPos> ceilPositions = Sets.newHashSet();
|
||||||
MutableBlockPos mut = new MutableBlockPos();
|
MutableBlockPos mut = new MutableBlockPos();
|
||||||
|
Set<BlockPos> remove = Sets.newHashSet();
|
||||||
caveBlocks.forEach((bpos) -> {
|
caveBlocks.forEach((bpos) -> {
|
||||||
mut.set(bpos);
|
mut.set(bpos);
|
||||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
int height = world.getHeight(Types.WORLD_SURFACE, bpos.getX(), bpos.getZ());
|
||||||
|
if (mut.getY() >= height) {
|
||||||
|
remove.add(bpos);
|
||||||
|
}
|
||||||
|
else if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||||
mut.setY(bpos.getY() - 1);
|
mut.setY(bpos.getY() - 1);
|
||||||
int height = world.getHeight(Types.WORLD_SURFACE, pos.getX(), pos.getZ());
|
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN) && mut.getY() < height) {
|
|
||||||
floorPositions.add(mut.immutable());
|
floorPositions.add(mut.immutable());
|
||||||
}
|
}
|
||||||
mut.setY(bpos.getY() + 1);
|
mut.setY(bpos.getY() + 1);
|
||||||
|
@ -105,6 +109,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
||||||
BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||||
placeFloor(world, biome, floorPositions, random, surfaceBlock);
|
placeFloor(world, biome, floorPositions, random, surfaceBlock);
|
||||||
placeCeil(world, biome, ceilPositions, random);
|
placeCeil(world, biome, ceilPositions, random);
|
||||||
|
caveBlocks.removeAll(remove);
|
||||||
placeWalls(world, biome, caveBlocks, random);
|
placeWalls(world, biome, caveBlocks, random);
|
||||||
}
|
}
|
||||||
fixBlocks(world, preCaveBlocks);
|
fixBlocks(world, preCaveBlocks);
|
||||||
|
@ -116,8 +121,8 @@ public class TunelCaveFeature extends EndCaveFeature {
|
||||||
private Set<BlockPos> mutateBlocks(Set<BlockPos> caveBlocks) {
|
private Set<BlockPos> mutateBlocks(Set<BlockPos> caveBlocks) {
|
||||||
Set<BlockPos> result = Sets.newHashSet();
|
Set<BlockPos> result = Sets.newHashSet();
|
||||||
caveBlocks.forEach(pos -> {
|
caveBlocks.forEach(pos -> {
|
||||||
int dx = pos.getX() + (int) (BIOME_NOISE_X.eval(pos.getX() * 0.2, pos.getZ() * 0.2) * 5);
|
int dx = pos.getX() + (int) (BIOME_NOISE_X.eval(pos.getX() * 0.3, pos.getZ() * 0.3) * 10);
|
||||||
int dz = pos.getZ() + (int) (BIOME_NOISE_Z.eval(pos.getX() * 0.2, pos.getZ() * 0.2) * 5);
|
int dz = pos.getZ() + (int) (BIOME_NOISE_Z.eval(pos.getX() * 0.3, pos.getZ() * 0.3) * 10);
|
||||||
if ((dx >> 4) == (pos.getX() >> 4) && (dz >> 4) == (pos.getZ() >> 4)) {
|
if ((dx >> 4) == (pos.getX() >> 4) && (dz >> 4) == (pos.getZ() >> 4)) {
|
||||||
result.add(pos);
|
result.add(pos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue