From f13a5a7b3d7a41fed0aa40224218a1faccba4c30 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 14 Apr 2019 11:38:44 +0200 Subject: [PATCH] add a height limit for the roots Closes #46 --- .../java/de/ellpeck/naturesaura/gen/WorldGenAncientTree.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/de/ellpeck/naturesaura/gen/WorldGenAncientTree.java b/src/main/java/de/ellpeck/naturesaura/gen/WorldGenAncientTree.java index 503c6dc5..cd710baa 100644 --- a/src/main/java/de/ellpeck/naturesaura/gen/WorldGenAncientTree.java +++ b/src/main/java/de/ellpeck/naturesaura/gen/WorldGenAncientTree.java @@ -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); }