mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 21:09:51 +00:00
Fix branch end detection, it was adding every branch section
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user