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);
}
});

View file

@ -159,15 +159,6 @@ public class DragonTreeFeature extends DefaultFeature {
return info.getState();
});
sphere.fillRecursiveIgnore(world, pos, IGNORE);
/*Collection<PosInfo> list = sphere.fillRecursiveIgnore(world, pos, IGNORE);
list.forEach((info) -> {
if (info.getState().getBlock() instanceof LeavesBlock && info.getState().get(LeavesBlock.DISTANCE) == 6) {
BlockState state = BlocksHelper.getLeavesState(info.getState(), world, info.getPos());
if (!state.equals(info.getState())) {
BlocksHelper.setWithoutUpdate(world, info.getPos(), state);
}
}
});*/
if (radius > 5) {

View file

@ -90,7 +90,7 @@ public class TenaneaFeature extends DefaultFeature {
List<BlockPos> support = Lists.newArrayList();
sphere.setPostProcess((info) -> {
if (random.nextBoolean() && info.getStateDown().isAir()) {
if (random.nextInt(6) == 0 && info.getStateDown().isAir()) {
BlockPos d = info.getPos().down();
support.add(d);
}
@ -141,20 +141,23 @@ public class TenaneaFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.TENANEA.bark);
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);
}
});
}