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

View file

@ -90,7 +90,7 @@ public class TenaneaFeature extends DefaultFeature {
List<BlockPos> support = Lists.newArrayList(); List<BlockPos> support = Lists.newArrayList();
sphere.setPostProcess((info) -> { sphere.setPostProcess((info) -> {
if (random.nextBoolean() && info.getStateDown().isAir()) { if (random.nextInt(6) == 0 && info.getStateDown().isAir()) {
BlockPos d = info.getPos().down(); BlockPos d = info.getPos().down();
support.add(d); support.add(d);
} }
@ -141,20 +141,23 @@ public class TenaneaFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.TENANEA.bark); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.TENANEA.bark);
support.forEach((bpos) -> { support.forEach((bpos) -> {
int count = MHelper.randRange(3, 8, random); BlockState state = world.getBlockState(bpos);
mut.set(bpos); if (state.isAir() || state.isOf(EndBlocks.TENANEA_OUTER_LEAVES)) {
if (world.isAir(mut) && world.getBlockState(mut.up()).isOf(EndBlocks.TENANEA_LEAVES)) { int count = MHelper.randRange(3, 8, random);
BlocksHelper.setWithoutUpdate(world, mut, top); mut.set(bpos);
for (int i = 1; i < count; i++) { if (world.getBlockState(mut.up()).isOf(EndBlocks.TENANEA_LEAVES)) {
mut.setY(mut.getY() - 1); BlocksHelper.setWithoutUpdate(world, mut, top);
if (world.isAir(mut.down())) { for (int i = 1; i < count; i++) {
BlocksHelper.setWithoutUpdate(world, mut, middle); mut.setY(mut.getY() - 1);
} if (world.isAir(mut.down())) {
else { BlocksHelper.setWithoutUpdate(world, mut, middle);
break; }
else {
break;
}
} }
BlocksHelper.setWithoutUpdate(world, mut, bottom);
} }
BlocksHelper.setWithoutUpdate(world, mut, bottom);
} }
}); });
} }