mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-24 22:14:44 +00:00
32 lines
1.0 KiB
Java
32 lines
1.0 KiB
Java
package binnie.extratrees.gen;
|
|
|
|
import forestry.api.arboriculture.ITree;
|
|
|
|
public class WorldGenCitrus extends WorldGenTree {
|
|
public WorldGenCitrus(final ITree tree) {
|
|
super(tree);
|
|
}
|
|
|
|
@Override
|
|
public void generate() {
|
|
this.generateTreeTrunk(this.height, this.girth);
|
|
int leafSpawn = this.height;
|
|
final float width = this.height / this.randBetween(1.1f, 1.5f);
|
|
final int bottom = this.randBetween(1, 2);
|
|
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, this.leaf, false);
|
|
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, this.leaf, false);
|
|
while (leafSpawn > bottom) {
|
|
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, this.leaf, false);
|
|
}
|
|
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, this.leaf, false);
|
|
}
|
|
|
|
@Override
|
|
public void preGenerate() {
|
|
this.minHeight = this.randBetween(2, 3);
|
|
this.height = this.determineHeight(6, 1);
|
|
this.girth = this.determineGirth(this.treeGen.getGirth());
|
|
}
|
|
|
|
}
|