Vent fixes

This commit is contained in:
paulevsGitch 2020-12-13 20:08:55 +03:00
parent 0ea0c0f60d
commit 7ae608af71

View file

@ -19,15 +19,16 @@ public class SurfaceVentFeature extends DefaultFeature {
@Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
Mutable mut = new Mutable();
int count = MHelper.randRange(5, 20, random);
int count = MHelper.randRange(15, 30, random);
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.WATERLOGGED, false);
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
for (int i = 0; i < count; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 10, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
if (dist > 0) {
BlockState state = world.getBlockState(mut);
for (int n = 0; n < 20 && state.isAir(); n++) {
for (int n = 0; n < 10 && state.isAir(); n++) {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}