mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Fix #1819 Crash when growing short Sipiri trees
This commit is contained in:
1 parent
9269af7a13
commit
e1d017f077
1 file changed
+10
-8
@@ -49,15 +49,17 @@ public class WorldGenGreenheart extends WorldGenTree {
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.5f + girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn, 0), girth, 0.5f + girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
|
||||
// Add some smaller twigs below for flavour
|
||||
for (int times = 0; times < height / 4; times++) {
|
||||
int h = 10 + rand.nextInt(height - 10);
|
||||
if (rand.nextBoolean() && h < height / 2) {
|
||||
h = height / 2 + rand.nextInt(height / 2);
|
||||
if (height > 10) {
|
||||
// Add some smaller twigs below for flavour
|
||||
for (int times = 0; times < height / 4; times++) {
|
||||
int h = 10 + rand.nextInt(height - 10);
|
||||
if (rand.nextBoolean() && h < height / 2) {
|
||||
h = height / 2 + rand.nextInt(height / 2);
|
||||
}
|
||||
int x_off = -1 + rand.nextInt(3);
|
||||
int y_off = -1 + rand.nextInt(3);
|
||||
WorldGenHelper.generateSphere(world, startPos.add(x_off, h, y_off), 1 + rand.nextInt(1), leaf, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
int x_off = -1 + rand.nextInt(3);
|
||||
int y_off = -1 + rand.nextInt(3);
|
||||
WorldGenHelper.generateSphere(world, startPos.add(x_off, h, y_off), 1 + rand.nextInt(1), leaf, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user