Fix decaying shrub leaves Fix #165 (#171)

This commit is contained in:
Alexander Kornilov authored and mezz committed 2017-07-05 22:16:46 -07:00
1 parent ec790c9333
commit 5846f59d64
8 files changed
+37 -27

No files matched your search

@@ -1,12 +1,13 @@
package binnie.extratrees.worldgen;
import binnie.core.Mods;
import binnie.extratrees.ExtraTrees;
import forestry.api.world.ITreeGenData;
import net.minecraft.world.World;
public class BlockTypeLeaf extends BlockType {
public BlockTypeLeaf() {
super(Mods.forestry.block("leaves"), 0);
public BlockTypeLeaf(boolean decay) {
super(decay ? Mods.forestry.block("leaves") : ExtraTrees.blockShrubLeaves, 0);
}
@Override
@@ -24,11 +24,6 @@ public class WorldGenDefault extends WorldGenTree {
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
@Override
public BlockType getLeaf() {
return new BlockTypeLeaf();
}
@Override
public BlockType getWood() {
return new BlockTypeLog(((ExtraTreeSpecies) treeGen.getGenome().getPrimary()).getLog());
@@ -15,18 +15,10 @@ public class WorldGenShrub extends WorldGenTree {
width = 1.5f;
}
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(0.0f, h, 0.0f), 0.4f * width, 1, leaf, false);
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(0.0f, h2, 0.0f), 0.8f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn >= 0.0f) {
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(0.0f, h3, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
}
@@ -36,4 +28,9 @@ public class WorldGenShrub extends WorldGenTree {
height = determineHeight(1, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
@Override
public BlockType getLeaf() {
return new BlockTypeLeaf(false);
}
}
@@ -75,7 +75,7 @@ public abstract class WorldGenTree extends WorldGenerator {
}
public BlockType getLeaf() {
return new BlockTypeLeaf();
return new BlockTypeLeaf(true);
}
public BlockType getWood() {