Small fixes

This commit is contained in:
paulevsGitch 2020-11-27 17:57:39 +03:00
parent 15abc9f07f
commit 5a62974f12
3 changed files with 32 additions and 35 deletions

View file

@ -55,7 +55,7 @@ public class TenaneaBushFeature extends DefaultFeature {
if (info.getState().getBlock() instanceof LeavesBlock) {
int distance = info.getPos().getManhattanDistance(pos);
if (distance < 7) {
if (random.nextBoolean() && info.getStateDown().isAir()) {
if (random.nextInt(4) == 0 && info.getStateDown().isAir()) {
BlockPos d = info.getPos().down();
support.add(d);
}
@ -90,20 +90,23 @@ public class TenaneaBushFeature extends DefaultFeature {
BlockState middle = EndBlocks.TENANEA_FLOWERS.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.TENANEA_FLOWERS.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
support.forEach((bpos) -> {
int count = MHelper.randRange(3, 8, random);
mut.set(bpos);
if (world.isAir(mut) && world.getBlockState(mut.up()).isOf(EndBlocks.TENANEA_LEAVES)) {
BlocksHelper.setWithoutUpdate(world, mut, top);
for (int i = 1; i < count; i++) {
mut.setY(mut.getY() - 1);
if (world.isAir(mut.down())) {
BlocksHelper.setWithoutUpdate(world, mut, middle);
}
else {
break;
BlockState state = world.getBlockState(bpos);
if (state.isAir() || state.isOf(EndBlocks.TENANEA_OUTER_LEAVES)) {
int count = MHelper.randRange(3, 8, random);
mut.set(bpos);
if (world.getBlockState(mut.up()).isOf(EndBlocks.TENANEA_LEAVES)) {
BlocksHelper.setWithoutUpdate(world, mut, top);
for (int i = 1; i < count; i++) {
mut.setY(mut.getY() - 1);
if (world.isAir(mut.down())) {
BlocksHelper.setWithoutUpdate(world, mut, middle);
}
else {
break;
}
}
BlocksHelper.setWithoutUpdate(world, mut, bottom);
}
BlocksHelper.setWithoutUpdate(world, mut, bottom);
}
});