Fix branch end detection, it was adding every branch section

This commit is contained in:
mezz committed 2016-05-21 17:51:59 -07:00
1 parent 7bd7357684
commit 292a0f029e
1 file changed
+6 -1
@@ -268,6 +268,7 @@ public class WorldGenHelper {
int x = 0;
int z = 0;
BlockPos branchEnd = null;
for (int r = 0; r < radius; r++) {
if (rand.nextFloat() < spreadY) {
// make branches only spread up, not down
@@ -299,11 +300,15 @@ public class WorldGenHelper {
BlockPos pos = branchStart.add(x, y, z);
if (addBlock(world, pos, wood, EnumReplaceMode.SOFT)) {
branchEnds.add(pos);
branchEnd = pos;
} else {
break;
}
}
if (branchEnd != null) {
branchEnds.add(branchEnd);
}
}
}