mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-27 15:33:12 +00:00
Start to clean up tree generation
This commit is contained in:
1 parent
c93a79887f
commit
8f77efae6e
11 files changed
+132
-155
No files matched your search
@@ -179,6 +179,9 @@ public class DesignBlock {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < this.rotation; ++i) {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.DOWN);
|
||||
@@ -264,6 +267,9 @@ public class DesignBlock {
|
||||
layout = layout.flipHorizontal();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.EAST) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.List;
|
||||
|
||||
public class DesignerManager {
|
||||
public static DesignerManager instance = new DesignerManager();
|
||||
;
|
||||
|
||||
List<IDesignSystem> systems;
|
||||
|
||||
public DesignerManager() {
|
||||
|
||||
@@ -1,104 +1,83 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import forestry.arboriculture.worldgen.TreeBlockTypeLeaf;
|
||||
import forestry.core.worldgen.WorldGenHelper;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class WorldGenApple {
|
||||
public static class OrchardApple extends WorldGenTree {
|
||||
public static class OrchardApple extends forestry.arboriculture.worldgen.WorldGenTree {
|
||||
public OrchardApple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
super(tree, 3, 6);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int leafSpawn = this.height;
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
while (leafSpawn > 2) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
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());
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class SweetCrabapple extends WorldGenTree {
|
||||
public static class SweetCrabapple extends forestry.arboriculture.worldgen.WorldGenTree {
|
||||
public SweetCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
super(tree, 4, 4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
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);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
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());
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class FloweringCrabapple extends WorldGenTree {
|
||||
public static class FloweringCrabapple extends forestry.arboriculture.worldgen.WorldGenTree {
|
||||
public FloweringCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
super(tree, 3, 6);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
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);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, this.leaf, false);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 3F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
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());
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
|
||||
public static class PrairieCrabapple extends WorldGenTree {
|
||||
public static class PrairieCrabapple extends forestry.arboriculture.worldgen.WorldGenTree {
|
||||
public PrairieCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
super(tree, 4, 4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
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);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.5F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
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());
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1F + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,8 +72,8 @@ public class WorldGenEucalyptus {
|
||||
for (int x = 0; x < this.girth; ++x) {
|
||||
for (int y = 0; y < this.girth; ++y) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
//TODO Eucalyptus2 log
|
||||
//this.addBlock(x - offset, i, y - offset, new BlockTypeLog(EnumExtraTreeLog.Eucalyptus2), true);
|
||||
//TODO:
|
||||
//this.addBlock(x - offset, i, y - offset, new BlockTypeLog(EnumETLog.Eucalyptus2), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,58 +1,52 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import forestry.arboriculture.worldgen.TreeBlockTypeLeaf;
|
||||
import forestry.core.worldgen.WorldGenHelper;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.arboriculture.worldgen.WorldGenTree;
|
||||
|
||||
public class WorldGenWalnut {
|
||||
public static class BlackWalnut extends WorldGenTree {
|
||||
public BlackWalnut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
super(tree, 9, 6);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
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);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.6f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
while (leafSpawn > 3) {
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.8f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
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());
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.7f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.2f - girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class Butternut extends WorldGenTree {
|
||||
public Butternut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
super(tree, 6, 3);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
this.generateTreeTrunk(this.height, this.girth);
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
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);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 0.9f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.9f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2.9f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
while (leafSpawn > 3) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, this.leaf, false);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 2.9f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
if (this.rand.nextBoolean()) {
|
||||
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, this.leaf, false);
|
||||
if (rand.nextBoolean()) {
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, 1.9f + girth, 1, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.height = this.determineHeight(6, 3);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user