add a height limit for the roots

Closes #46
This commit is contained in:
Ellpeck 2019-04-14 11:38:44 +02:00
parent b10545994a
commit f13a5a7b3d

View file

@ -37,6 +37,8 @@ public class WorldGenAncientTree extends WorldGenAbstractTree {
BlockPos goal = pos.add(x, 0, z);
while (!world.getBlockState(goal).isFullBlock()) {
goal = goal.down();
if (goal.distanceSq(pos) >= 10 * 10)
break;
}
this.makeBranch(world, pos.up(rand.nextInt(1)), goal, ModBlocks.ANCIENT_BARK.getDefaultState(), false);
}