mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
fixed the ancient tree gen not deleting the sapling
This commit is contained in:
parent
e8e3457b34
commit
c2c88dec61
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,6 @@ import net.minecraft.world.gen.feature.TreeFeatureConfig;
|
|||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
// TODO figure out if this still works like it should
|
||||
public class WorldGenAncientTree extends AbstractTreeFeature<TreeFeatureConfig> {
|
||||
|
||||
// what the heck even is this
|
||||
|
@ -31,6 +30,7 @@ public class WorldGenAncientTree extends AbstractTreeFeature<TreeFeatureConfig>
|
|||
int height = rand.nextInt(3) + 5;
|
||||
BlockPos trunkTop = pos.up(height);
|
||||
|
||||
this.setBlockState(world, pos, Blocks.AIR.getDefaultState());
|
||||
//Roots
|
||||
int rootsAmount = rand.nextInt(4) + 5;
|
||||
for (int i = 0; i < rootsAmount; i++) {
|
||||
|
@ -40,7 +40,7 @@ public class WorldGenAncientTree extends AbstractTreeFeature<TreeFeatureConfig>
|
|||
float z = (float) Math.cos(angle) * length;
|
||||
|
||||
BlockPos goal = pos.add(x, 0, z);
|
||||
while (!world.hasBlockState(goal, state -> state.getMaterial().isReplaceable())) {
|
||||
while (world.hasBlockState(goal, state -> state.getMaterial().isReplaceable())) {
|
||||
goal = goal.down();
|
||||
if (goal.distanceSq(pos) >= 10 * 10)
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue