mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 23:12:58 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class TreeGenBase extends WorldGenerator
|
||||
{
|
||||
protected ITree tree;
|
||||
protected ITreeGenData treeGen;
|
||||
protected World world;
|
||||
protected Random rand;
|
||||
protected int startX;
|
||||
protected int startY;
|
||||
protected int startZ;
|
||||
protected int girth;
|
||||
protected int height;
|
||||
protected int minHeight;
|
||||
protected int maxHeight;
|
||||
protected boolean spawnPods;
|
||||
protected int minPodHeight;
|
||||
|
||||
public TreeGenBase() {
|
||||
this.minHeight = 4;
|
||||
this.maxHeight = 80;
|
||||
this.spawnPods = false;
|
||||
this.minPodHeight = 3;
|
||||
}
|
||||
|
||||
protected final int randBetween(final int a, final int b) {
|
||||
return a + this.rand.nextInt(b - a);
|
||||
}
|
||||
|
||||
protected final float randBetween(final float a, final float b) {
|
||||
return a + this.rand.nextFloat() * (b - a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int x, final int y, final int z) {
|
||||
this.world = world;
|
||||
this.startX = x;
|
||||
this.startY = y;
|
||||
this.startZ = z;
|
||||
this.girth = this.tree.getGirth(world, x, y, z);
|
||||
this.height = (int) (this.randBetween(this.getHeight()[0], this.getHeight()[1]) * this.tree.getGenome().getHeight());
|
||||
if (this.tree.canGrow(world, x, y, z, this.girth, this.height)) {
|
||||
this.generate();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void generate() {
|
||||
}
|
||||
|
||||
protected int[] getHeight() {
|
||||
return new int[] { 5, 2 };
|
||||
}
|
||||
|
||||
private static class Vector
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
public Vector(final int x, final int y, final int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAlder
|
||||
{
|
||||
public static class CommonAlder extends WorldGenTree
|
||||
{
|
||||
public CommonAlder(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
final float width = this.height * this.randBetween(0.4f, 0.45f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
}
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenApple
|
||||
{
|
||||
public static class OrchardApple extends WorldGenTree
|
||||
{
|
||||
public OrchardApple(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > 2) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(3, 6);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class SweetCrabapple extends WorldGenTree
|
||||
{
|
||||
public SweetCrabapple(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 4);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class FloweringCrabapple extends WorldGenTree
|
||||
{
|
||||
public FloweringCrabapple(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(3, 6);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class PrairieCrabapple extends WorldGenTree
|
||||
{
|
||||
public PrairieCrabapple(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 4);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAsh
|
||||
{
|
||||
public static class CommonAsh extends WorldGenTree
|
||||
{
|
||||
public CommonAsh(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.35f, 0.45f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBanana extends WorldGenTree
|
||||
{
|
||||
public WorldGenBanana(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.bushiness = 0.9f;
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
final float width = this.height / this.randBetween(1.8f, 2.0f);
|
||||
final int bottom = this.randBetween(3, 4);
|
||||
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), width, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public class WorldGenBeech
|
||||
{
|
||||
public static class CommonBeech extends WorldGenTree
|
||||
{
|
||||
public CommonBeech(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.47f, 0.5f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class CopperBeech extends CommonBeech
|
||||
{
|
||||
public CopperBeech(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCitrus extends WorldGenTree
|
||||
{
|
||||
public WorldGenCitrus(final ITreeGenData 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(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenConifer
|
||||
{
|
||||
public static class WesternHemlock extends WorldGenTree
|
||||
{
|
||||
public WesternHemlock(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 6;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height / this.randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Cypress extends WorldGenTree
|
||||
{
|
||||
public Cypress(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = 1.0f;
|
||||
float width = this.height * this.randBetween(0.15f, 0.2f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width - 1.0f;
|
||||
++radius;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Yew extends WorldGenTree
|
||||
{
|
||||
public Yew(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= 2.0f - radius;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Cedar extends WorldGenTree
|
||||
{
|
||||
public Cedar(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 3;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height * this.randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), this.girth, 1, this.leaf, false);
|
||||
}
|
||||
for (leafSpawn = this.height + 3; leafSpawn > bottom; leafSpawn += 1 + this.rand.nextInt(2)) {
|
||||
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
float radius = (0.7f + this.rand.nextFloat() * 0.3f) * width;
|
||||
float xOffset = (-width + this.rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
float yOffset = (-width + this.rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
cone *= 2.0f - cone;
|
||||
xOffset *= cone;
|
||||
yOffset *= cone;
|
||||
radius *= cone;
|
||||
if (radius < 2.0f) {
|
||||
radius = 2.0f;
|
||||
}
|
||||
if (xOffset > radius / 2.0f) {
|
||||
xOffset = radius / 2.0f;
|
||||
}
|
||||
if (yOffset > radius / 2.0f) {
|
||||
yOffset = radius / 2.0f;
|
||||
}
|
||||
final float f2 = xOffset;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, yOffset), 0.7f * radius, 1, this.leaf, false);
|
||||
final float f3 = xOffset;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, yOffset), radius, 1, this.leaf, false);
|
||||
final float f4 = xOffset;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, yOffset), 0.5f * radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class LoblollyPine extends WorldGenTree
|
||||
{
|
||||
public LoblollyPine(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.height * this.randBetween(0.65f, 0.7f);
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.6f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class MonkeyPuzzle extends WorldGenTree
|
||||
{
|
||||
public MonkeyPuzzle(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height * this.randBetween(0.4f, 0.45f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.35f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.55f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.75f * width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 1.0f * width, 1, this.leaf, false);
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), 0.5f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(9, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import binnie.extratrees.worldgen.BlockTypeLog;
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import binnie.extratrees.worldgen.BlockTypeLeaf;
|
||||
import binnie.extratrees.worldgen.BlockType;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenDefault extends WorldGenTree
|
||||
{
|
||||
public WorldGenDefault(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getLeaf() {
|
||||
return new BlockTypeLeaf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getWood() {
|
||||
return new BlockTypeLog(((ExtraTreeSpecies) this.treeGen.getGenome().getPrimary()).getLog());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import binnie.extratrees.worldgen.BlockTypeLog;
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenEucalyptus
|
||||
{
|
||||
public static class SwampGum extends WorldGenTree
|
||||
{
|
||||
public SwampGum(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float weakerBottm = this.randBetween(0.5f, 0.6f) * this.height;
|
||||
final float bottom = this.randBetween(0.4f, 0.5f) * this.height;
|
||||
float width = this.height * this.randBetween(0.15f, 0.2f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
this.bushiness = 0.3f;
|
||||
while (leafSpawn > weakerBottm) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.9f, 1.0f) * width, 1, this.leaf, false);
|
||||
}
|
||||
this.bushiness = 0.6f;
|
||||
while (leafSpawn > bottom) {
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), this.randBetween(0.8f, 0.9f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.5f * width, 1, this.leaf, false);
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
final float f6 = this.randBetween(-1, 1);
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateSphere(new Vector(f6, h6, this.randBetween(-1, 1)), this.randBetween(1, 2), this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(14, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RoseGum extends WorldGenTree
|
||||
{
|
||||
public RoseGum(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
final int offset = (this.girth - 1) / 2;
|
||||
for (int x = 0; x < this.girth; ++x) {
|
||||
for (int y = 0; y < this.girth; ++y) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
this.addBlock(x - offset, i, y - offset, new BlockTypeLog(ILogType.ExtraTreeLog.Eucalyptus2), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(0.4f, 0.5f) * this.height;
|
||||
float width = this.height * this.randBetween(0.05f, 0.1f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
this.bushiness = 0.5f;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
this.bushiness = 0.1f;
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.9f, 1.1f) * width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(9, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RainbowGum extends WorldGenTree
|
||||
{
|
||||
public RainbowGum(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(0.5f, 0.6f) * this.height;
|
||||
float width = this.height * this.randBetween(0.15f, 0.2f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenFir
|
||||
{
|
||||
public static class DouglasFir extends WorldGenTree
|
||||
{
|
||||
public DouglasFir(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float patchyBottom = this.height / 2;
|
||||
final float bottom = this.randBetween(3, 4);
|
||||
final float width = this.height * this.randBetween(0.35f, 0.4f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
this.bushiness = 0.1f;
|
||||
while (leafSpawn > patchyBottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.9f, 1.1f) * width, 1, this.leaf, false);
|
||||
}
|
||||
this.bushiness = 0.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), this.randBetween(0.7f, 1.0f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class SilverFir extends WorldGenTree
|
||||
{
|
||||
public SilverFir(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height / this.randBetween(2.5f, 3.0f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class BalsamFir extends WorldGenTree
|
||||
{
|
||||
public BalsamFir(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = 1.0f;
|
||||
float width = this.height / this.randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenHolly
|
||||
{
|
||||
public static class Holly extends WorldGenTree
|
||||
{
|
||||
public Holly(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 1.0f;
|
||||
float width = this.height * this.randBetween(0.4f, 0.45f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width = 1.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenJungle
|
||||
{
|
||||
public static class Brazilwood extends WorldGenTree
|
||||
{
|
||||
public Brazilwood(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = 1.0f;
|
||||
float width = this.height * this.randBetween(0.15f, 0.2f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Logwood extends WorldGenTree
|
||||
{
|
||||
public Logwood(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Rosewood extends WorldGenTree
|
||||
{
|
||||
public Rosewood(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Purpleheart extends WorldGenTree
|
||||
{
|
||||
public Purpleheart(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.height - 3;
|
||||
float width = this.height * this.randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class OsangeOsange extends WorldGenTree
|
||||
{
|
||||
public OsangeOsange(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class OldFustic extends WorldGenTree
|
||||
{
|
||||
public OldFustic(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.7f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Coffee extends WorldGenTree
|
||||
{
|
||||
public Coffee(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = 1.0f;
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(3, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class BrazilNut extends WorldGenTree
|
||||
{
|
||||
public BrazilNut(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.height - 3;
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Shrub15 extends WorldGenTree
|
||||
{
|
||||
public Shrub15(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = 1.0f;
|
||||
float width = this.height * this.randBetween(0.15f, 0.2f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenLazy
|
||||
{
|
||||
public static class Tree extends WorldGenTree
|
||||
{
|
||||
public Tree(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.height / 2 - 1;
|
||||
float width = this.height * this.randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenMaple
|
||||
{
|
||||
public static class RedMaple extends WorldGenTree
|
||||
{
|
||||
public RedMaple(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
final float bottom2 = (this.height + bottom) / 2.0f;
|
||||
float width = 2.0f;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom2) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
}
|
||||
width += 0.6;
|
||||
while (leafSpawn > bottom) {
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
}
|
||||
if (leafSpawn == bottom) {
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), width - 0.6f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPalm
|
||||
{
|
||||
public static class Coconut extends WorldGenTree
|
||||
{
|
||||
public Coconut(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
float width = this.height * this.randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.6f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPoplar
|
||||
{
|
||||
public static class Aspen extends WorldGenTree
|
||||
{
|
||||
public Aspen(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(this.height / 2, this.height / 2 + 1) + 1;
|
||||
float width = this.height * this.randBetween(0.25f, 0.35f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.5f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), this.randBetween(0.9f, 1.1f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPrune extends WorldGenTree
|
||||
{
|
||||
public WorldGenPrune(final ITreeGenData 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.7f, 2.1f);
|
||||
final int bottom = this.randBetween(2, 3);
|
||||
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.6f * width, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public class WorldGenShrub
|
||||
{
|
||||
public static class Shrub extends WorldGenTree
|
||||
{
|
||||
public Shrub(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
float leafSpawn = this.height;
|
||||
float width = this.height * this.randBetween(0.7f, 0.9f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn >= 0.0f) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.minHeight = 1;
|
||||
this.height = this.determineHeight(1, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSorbus
|
||||
{
|
||||
public static class Whitebeam extends WorldGenTree
|
||||
{
|
||||
public Whitebeam(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.5f, 0.6f);
|
||||
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.6f * width, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Rowan extends WorldGenTree
|
||||
{
|
||||
public Rowan(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.5f, 0.6f);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ServiceTree extends WorldGenTree
|
||||
{
|
||||
public ServiceTree(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
while (leafSpawn > 2) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.4f + this.rand.nextFloat() * 0.7f, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(8, 6);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSpruce
|
||||
{
|
||||
public static class GiantSpruce extends WorldGenTree
|
||||
{
|
||||
public GiantSpruce(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 3;
|
||||
final float bottom = this.randBetween(3, 4);
|
||||
final float width = this.height / this.randBetween(2.5f, 3.0f);
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius = 0.15f + 0.85f * radius;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(15, 4);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class AlpineSpruce extends WorldGenTree
|
||||
{
|
||||
public AlpineSpruce(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 5;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height / this.randBetween(2.0f, 2.5f);
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
leafSpawn -= 2.0f;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= radius;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class WhiteSpruce extends WorldGenTree
|
||||
{
|
||||
public WhiteSpruce(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height / this.randBetween(2.2f, 2.5f);
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius = (float) Math.sqrt(radius);
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlackSpruce extends WorldGenTree
|
||||
{
|
||||
public BlackSpruce(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height / this.randBetween(2.2f, 2.5f);
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius = (float) Math.sqrt(radius);
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTilia
|
||||
{
|
||||
public static class Basswood extends WorldGenTree
|
||||
{
|
||||
public Basswood(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.4f, 0.5f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class WhiteBasswood extends WorldGenTree
|
||||
{
|
||||
public WhiteBasswood(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.4f, 0.5f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CommonLime extends WorldGenTree
|
||||
{
|
||||
public CommonLime(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
final float width = this.height * this.randBetween(0.45f, 0.55f);
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(7, 4);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import binnie.extratrees.worldgen.BlockTypeVoid;
|
||||
import net.minecraft.init.Blocks;
|
||||
import binnie.extratrees.worldgen.BlockTypeLog;
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import binnie.extratrees.worldgen.BlockTypeLeaf;
|
||||
import binnie.extratrees.worldgen.BlockType;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public abstract class WorldGenTree extends WorldGenerator
|
||||
{
|
||||
protected ITreeGenData treeGen;
|
||||
protected World world;
|
||||
protected Random rand;
|
||||
protected int startX;
|
||||
protected int startY;
|
||||
protected int startZ;
|
||||
protected int girth;
|
||||
protected int height;
|
||||
protected int minHeight;
|
||||
protected int maxHeight;
|
||||
protected boolean spawnPods;
|
||||
protected int minPodHeight;
|
||||
BlockType leaf;
|
||||
BlockType wood;
|
||||
BlockType vine;
|
||||
BlockType air;
|
||||
float bushiness;
|
||||
|
||||
protected int randBetween(final int a, final int b) {
|
||||
return a + this.rand.nextInt(b - a);
|
||||
}
|
||||
|
||||
protected float randBetween(final float a, final float b) {
|
||||
return a + this.rand.nextFloat() * (b - a);
|
||||
}
|
||||
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
public boolean canGrow() {
|
||||
return this.treeGen.canGrow(this.world, this.startX, this.startY, this.startZ, this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ), this.height);
|
||||
}
|
||||
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
|
||||
protected int determineGirth(final int base) {
|
||||
return base;
|
||||
}
|
||||
|
||||
protected int modifyByHeight(final int val, final int min, final int max) {
|
||||
final int determined = Math.round(val * this.treeGen.getHeightModifier());
|
||||
return (determined < min) ? min : ((determined > max) ? max : determined);
|
||||
}
|
||||
|
||||
protected int determineHeight(final int required, final int variation) {
|
||||
final int determined = Math.round((required + this.rand.nextInt(variation)) * this.treeGen.getHeightModifier());
|
||||
return (determined < this.minHeight) ? this.minHeight : ((determined > this.maxHeight) ? this.maxHeight : determined);
|
||||
}
|
||||
|
||||
public BlockType getLeaf() {
|
||||
return new BlockTypeLeaf();
|
||||
}
|
||||
|
||||
public BlockType getWood() {
|
||||
return new BlockTypeLog(((ExtraTreeSpecies) this.treeGen.getGenome().getPrimary()).getLog());
|
||||
}
|
||||
|
||||
public WorldGenTree(final ITreeGenData tree) {
|
||||
this.minHeight = 3;
|
||||
this.maxHeight = 80;
|
||||
this.spawnPods = false;
|
||||
this.minPodHeight = 3;
|
||||
this.vine = new BlockType(Blocks.vine, 0);
|
||||
this.air = new BlockTypeVoid();
|
||||
this.bushiness = 0.0f;
|
||||
this.spawnPods = tree.allowsFruitBlocks();
|
||||
if (tree instanceof ITreeGenData) {
|
||||
this.treeGen = tree;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean generate(final World world, final Random random, final int x, final int y, final int z) {
|
||||
return this.generate(world, random, x, y, z, false);
|
||||
}
|
||||
|
||||
public final boolean generate(final World world, final Random random, final int x, final int y, final int z, final boolean force) {
|
||||
this.world = world;
|
||||
this.rand = random;
|
||||
this.startX = x;
|
||||
this.startY = y;
|
||||
this.startZ = z;
|
||||
this.leaf = this.getLeaf();
|
||||
this.wood = this.getWood();
|
||||
this.preGenerate();
|
||||
if (!force && !this.canGrow()) {
|
||||
return false;
|
||||
}
|
||||
final int offset = (this.girth - 1) / 2;
|
||||
for (int x2 = 0; x2 < this.girth; ++x2) {
|
||||
for (int y2 = 0; y2 < this.girth; ++y2) {
|
||||
this.addBlock(x2, 0, y2, new BlockTypeVoid(), true);
|
||||
}
|
||||
}
|
||||
this.generate();
|
||||
return true;
|
||||
}
|
||||
|
||||
public final Vector getStartVector() {
|
||||
return new Vector(this.startX, this.startY, this.startZ);
|
||||
}
|
||||
|
||||
protected void generateTreeTrunk(final int height, final int width) {
|
||||
this.generateTreeTrunk(height, width, 0.0f);
|
||||
}
|
||||
|
||||
protected void generateTreeTrunk(final int height, final int width, final float vines) {
|
||||
final int offset = (width - 1) / 2;
|
||||
for (int x = 0; x < width; ++x) {
|
||||
for (int y = 0; y < width; ++y) {
|
||||
for (int i = 0; i < height; ++i) {
|
||||
this.addWood(x - offset, i, y - offset, true);
|
||||
if (this.rand.nextFloat() < vines) {
|
||||
this.addVine(x - offset - 1, i, y - offset);
|
||||
}
|
||||
if (this.rand.nextFloat() < vines) {
|
||||
this.addVine(x - offset + 1, i, y - offset);
|
||||
}
|
||||
if (this.rand.nextFloat() < vines) {
|
||||
this.addVine(x - offset, i, y - offset - 1);
|
||||
}
|
||||
if (this.rand.nextFloat() < vines) {
|
||||
this.addVine(x - offset, i, y - offset + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.spawnPods) {
|
||||
return;
|
||||
}
|
||||
for (int y2 = this.minPodHeight; y2 < height; ++y2) {
|
||||
for (int x2 = 0; x2 < this.girth; ++x2) {
|
||||
for (int z = 0; z < this.girth; ++z) {
|
||||
if (x2 <= 0 || x2 >= this.girth || z <= 0 || z >= this.girth) {
|
||||
this.treeGen.trySpawnFruitBlock(this.world, this.startX + x2 + 1, this.startY + y2, this.startZ + z);
|
||||
this.treeGen.trySpawnFruitBlock(this.world, this.startX + x2 - 1, this.startY + y2, this.startZ + z);
|
||||
this.treeGen.trySpawnFruitBlock(this.world, this.startX + x2, this.startY + y2, this.startZ + z + 1);
|
||||
this.treeGen.trySpawnFruitBlock(this.world, this.startX + x2, this.startY + y2, this.startZ + z - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void generateSupportStems(final int height, final int girth, final float chance, final float maxHeight) {
|
||||
for (int offset = 1, x = -offset; x < girth + offset; ++x) {
|
||||
for (int z = -offset; z < girth + offset; ++z) {
|
||||
if (x != -offset || z != -offset) {
|
||||
if (x != girth + offset || z != girth + offset) {
|
||||
if (x != -offset || z != girth + offset) {
|
||||
if (x != girth + offset || z != -offset) {
|
||||
final int stemHeight = this.rand.nextInt(Math.round(height * maxHeight));
|
||||
if (this.rand.nextFloat() < chance) {
|
||||
for (int i = 0; i < stemHeight; ++i) {
|
||||
this.addWood(x, i, z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final void clearBlock(final int x, final int y, final int z) {
|
||||
this.air.setBlock(this.world, this.treeGen, this.startX + x, this.startY + y, this.startZ + z);
|
||||
}
|
||||
|
||||
protected final void addBlock(final int x, final int y, final int z, final BlockType type, final boolean doReplace) {
|
||||
if (doReplace || this.world.isAirBlock(this.startX + x, this.startY + y, this.startZ + z)) {
|
||||
type.setBlock(this.world, this.treeGen, this.startX + x, this.startY + y, this.startZ + z);
|
||||
}
|
||||
}
|
||||
|
||||
protected final void addWood(final int x, final int y, final int z, final boolean doReplace) {
|
||||
this.addBlock(x, y, z, this.wood, doReplace);
|
||||
}
|
||||
|
||||
protected final void addLeaf(final int x, final int y, final int z, final boolean doReplace) {
|
||||
this.addBlock(x, y, z, this.leaf, doReplace);
|
||||
}
|
||||
|
||||
protected final void addVine(final int x, final int y, final int z) {
|
||||
this.addBlock(x, y, z, this.vine, false);
|
||||
}
|
||||
|
||||
protected final void generateCuboid(final Vector start, final Vector area, final BlockType block, final boolean doReplace) {
|
||||
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
|
||||
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
|
||||
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
|
||||
this.addBlock(x, y, z, block, doReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final void generateCylinder(final Vector center2, final float radius, final int height, final BlockType block, final boolean doReplace) {
|
||||
final float centerOffset = (this.girth - 1) / 2.0f;
|
||||
final Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
|
||||
final Vector start = new Vector(center3.x - radius, center3.y, center3.z - radius);
|
||||
final Vector area = new Vector(radius * 2.0f + 1.0f, height, radius * 2.0f + 1.0f);
|
||||
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
|
||||
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
|
||||
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
|
||||
if (Vector.distance(new Vector(x, y, z), new Vector(center3.x, y, center3.z)) <= radius + 0.01) {
|
||||
if (Vector.distance(new Vector(x, y, z), new Vector(center3.x, y, center3.z)) < radius - 0.5f || this.rand.nextFloat() >= this.bushiness) {
|
||||
this.addBlock(x, y, z, block, doReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final void generateCircle(final Vector center, final float radius, final int width, final int height, final BlockType block, final boolean doReplace) {
|
||||
this.generateCircle(center, radius, width, height, block, 1.0f, doReplace);
|
||||
}
|
||||
|
||||
protected final void generateCircle(final Vector center2, final float radius, final int width, final int height, final BlockType block, final float chance, final boolean doReplace) {
|
||||
final float centerOffset = (this.girth % 2 == 0) ? 0.5f : 0.0f;
|
||||
final Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
|
||||
final Vector start = new Vector(center3.x - radius, center3.y, center3.z - radius);
|
||||
final Vector area = new Vector(radius * 2.0f + 1.0f, height, radius * 2.0f + 1.0f);
|
||||
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
|
||||
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
|
||||
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
|
||||
if (this.rand.nextFloat() <= chance) {
|
||||
final double distance = Vector.distance(new Vector(x, y, z), new Vector(center3.x, y, center3.z));
|
||||
if (radius - width - 0.01 < distance && distance <= radius + 0.01) {
|
||||
this.addBlock(x, y, z, block, doReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final void generateSphere(final Vector center2, final int radius, final BlockType block, final boolean doReplace) {
|
||||
final float centerOffset = (this.girth - 1) / 2.0f;
|
||||
final Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
|
||||
final Vector start = new Vector(center3.x - radius, center3.y - radius, center3.z - radius);
|
||||
final Vector area = new Vector(radius * 2 + 1, radius * 2 + 1, radius * 2 + 1);
|
||||
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
|
||||
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
|
||||
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
|
||||
if (Vector.distance(new Vector(x, y, z), new Vector(center3.x, center3.y, center3.z)) <= radius + 0.01) {
|
||||
this.addBlock(x, y, z, block, doReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class Vector
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
|
||||
public Vector(final float f, final float h, final float g) {
|
||||
this.x = f;
|
||||
this.y = h;
|
||||
this.z = g;
|
||||
}
|
||||
|
||||
public static double distance(final Vector a, final Vector b) {
|
||||
return Math.sqrt(Math.pow(a.x - b.x, 2.0) + Math.pow(a.y - b.y, 2.0) + Math.pow(a.z - b.z, 2.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTree2
|
||||
{
|
||||
public static class Olive extends WorldGenTree
|
||||
{
|
||||
public Olive(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height * this.randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sweetgum extends WorldGenTree
|
||||
{
|
||||
public Sweetgum(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= 2.0f - radius;
|
||||
radius *= width;
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
|
||||
}
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Locust extends WorldGenTree
|
||||
{
|
||||
public Locust(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 2.0f;
|
||||
float width = this.height * this.randBetween(0.35f, 0.4f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom + 1.0f) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.3f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Pear extends WorldGenTree
|
||||
{
|
||||
public Pear(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(3, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Iroko extends WorldGenTree
|
||||
{
|
||||
public Iroko(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height * this.randBetween(0.45f, 0.5f);
|
||||
if (width < 2.5f) {
|
||||
width = 2.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width * 0.25f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width * 0.5f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width * 0.7f, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 2.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Gingko extends WorldGenTree
|
||||
{
|
||||
public Gingko(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 2;
|
||||
final float bottom = 2.0f;
|
||||
float width = this.height * this.randBetween(0.55f, 0.6f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 2.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom * 2.0f + 1.0f) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 1.5f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.9f, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 0.9f, 1, this.leaf, false);
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f7 = 0.0f;
|
||||
final float h7 = leafSpawn;
|
||||
leafSpawn = h7 - 1.0f;
|
||||
this.generateCylinder(new Vector(f7, h7, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Box extends WorldGenTree
|
||||
{
|
||||
public Box(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = 0.0f;
|
||||
final float width = 1.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(3, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Clove extends WorldGenTree
|
||||
{
|
||||
public Clove(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = 2.0f;
|
||||
float width = this.height * this.randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,413 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTree3
|
||||
{
|
||||
public static class Hazel extends WorldGenTree
|
||||
{
|
||||
public Hazel(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 3.0f;
|
||||
float width = this.height * this.randBetween(0.45f, 0.5f);
|
||||
if (width < 2.5f) {
|
||||
width = 2.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.6f, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 1.2f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sycamore extends WorldGenTree
|
||||
{
|
||||
public Sycamore(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height * this.randBetween(0.35f, 0.4f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.3f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.8f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Hawthorn extends WorldGenTree
|
||||
{
|
||||
public Hawthorn(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(1, 2);
|
||||
float width = this.height * this.randBetween(0.4f, 0.45f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Pecan extends WorldGenTree
|
||||
{
|
||||
public Pecan(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 2.0f;
|
||||
float width = this.height * this.randBetween(0.6f, 0.65f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.6f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), 0.6f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Elm extends WorldGenTree
|
||||
{
|
||||
public Elm(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = this.randBetween(2, 3);
|
||||
float width = this.height * this.randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Elder extends WorldGenTree
|
||||
{
|
||||
public Elder(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 3.0f;
|
||||
float width = this.height * this.randBetween(0.55f, 0.6f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Hornbeam extends WorldGenTree
|
||||
{
|
||||
public Hornbeam(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 2.0f;
|
||||
float width = this.height * this.randBetween(0.55f, 0.6f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sallow extends WorldGenTree
|
||||
{
|
||||
public Sallow(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 2.0f;
|
||||
float width = this.height * this.randBetween(0.6f, 0.65f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.6f * width, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), 0.6f * width, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(4, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class AcornOak extends WorldGenTree
|
||||
{
|
||||
public AcornOak(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height + 1;
|
||||
final float bottom = 3.0f;
|
||||
float width = this.height * this.randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width * 0.4f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width * 0.7f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.2f, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 0.5f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 2);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTropical
|
||||
{
|
||||
public static class Mango extends WorldGenTree
|
||||
{
|
||||
public Mango(final ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
float leafSpawn = this.height;
|
||||
float width = this.height * this.randBetween(0.7f, 0.75f);
|
||||
final float bottom = 2.0f;
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
final float f = 0.0f;
|
||||
final float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
this.generateCylinder(new Vector(f, h, 0.0f), width * 0.3f, 1, this.leaf, false);
|
||||
final float f2 = 0.0f;
|
||||
final float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
this.generateCylinder(new Vector(f2, h2, 0.0f), width * 0.5f, 1, this.leaf, false);
|
||||
final float f3 = 0.0f;
|
||||
final float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width * 0.7f, 1, this.leaf, false);
|
||||
final float f4 = 0.0f;
|
||||
final float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
this.generateCylinder(new Vector(f4, h4, 0.0f), width * 0.8f, 1, this.leaf, false);
|
||||
final float f5 = 0.0f;
|
||||
final float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
this.generateCylinder(new Vector(f5, h5, 0.0f), width * 0.9f, 1, this.leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
final float f6 = 0.0f;
|
||||
final float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
this.generateCylinder(new Vector(f6, h6, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
final float f7 = 0.0f;
|
||||
final float h7 = leafSpawn;
|
||||
leafSpawn = h7 - 1.0f;
|
||||
this.generateCylinder(new Vector(f7, h7, 0.0f), width - 1.0f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(5, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public class WorldGenWalnut
|
||||
{
|
||||
public static class BlackWalnut extends WorldGenTree
|
||||
{
|
||||
public BlackWalnut(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.6f, 1, this.leaf, false);
|
||||
while (leafSpawn > this.randBetween(3, 4)) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.8f, 1, this.leaf, false);
|
||||
}
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.7f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.8f, 1, this.leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(9, 6);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Butternut extends WorldGenTree
|
||||
{
|
||||
public Butternut(final ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
int leafSpawn = this.height + 1;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.5f, 1, this.leaf, false);
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, this.leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, this.leaf, false);
|
||||
}
|
||||
if (this.rand.nextBoolean()) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user