Files
Binnie/src/main/java/binnie/extratrees/worldgen/WorldGenRedMaple.java
T
ah-OOG-ah f0f14bb278 Minor cleanups (#50)
* Finalize, minor alloc reduction

Also enable Jabel and generic injection

* Update dependencies.gradle

* Clean up Machine a bit

* spotless

more enhanced instanceof

* Update ModuleMachine.java

* More clen

* WARN: Removed exception catching

* Many, many tiny patches + birthday fix

* Spotless

* Spotless again

* Fix getLow and clamp tolerance value

* Revert event -> ignored on unused event parameters

* Rename instanceof variables

* Update Machine.java

* Use StringBuilder

* Cache getStack()

* Oops, Jabel can't handle that

* Spotless

* Spotless again

My IDE was fighting with it

* Remove unused elements + scream test success
2024-09-26 16:59:20 +02:00

43 lines
1.3 KiB
Java

package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenRedMaple extends WorldGenTree {
public WorldGenRedMaple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(1, 2);
float bottom2 = (height + bottom) / 2.0f;
float width = 2.0f;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
while (leafSpawn > bottom2) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
}
width += 0.6f;
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
}
if (leafSpawn == bottom) {
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}