mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 04:32:24 +00:00
38 lines
1.2 KiB
Java
38 lines
1.2 KiB
Java
package binnie.extratrees.worldgen;
|
|
|
|
import forestry.api.world.ITreeGenData;
|
|
|
|
public class WorldGenMango extends WorldGenTree {
|
|
public WorldGenMango(ITreeGenData tree) {
|
|
super(tree);
|
|
}
|
|
|
|
@Override
|
|
public void generate() {
|
|
generateTreeTrunk(height, girth);
|
|
float leafSpawn = height;
|
|
float width = height * randBetween(0.7f, 0.75f);
|
|
float bottom = 2.0f;
|
|
if (width < 1.2) {
|
|
width = 1.55f;
|
|
}
|
|
|
|
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.3f, 1, leaf, false);
|
|
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.5f, 1, leaf, false);
|
|
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
|
|
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.8f, 1, leaf, false);
|
|
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.9f, 1, leaf, false);
|
|
|
|
while (leafSpawn > bottom) {
|
|
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
|
}
|
|
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
|
|
}
|
|
|
|
@Override
|
|
public void preGenerate() {
|
|
height = determineHeight(5, 1);
|
|
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
|
}
|
|
}
|