Package btw.world.feature.trees.grower
Class BigTreeGrower
java.lang.Object
api.world.feature.AbstractTreeGrower
btw.world.feature.trees.grower.BigTreeGrower
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]doubleintdoubleintintSets the limit of the random value used to initialize the height limit.doubleintSets the distance limit for how far away the generator will populate leaves from the base leaf node.int[][]Contains a list of a points at which to generate groups of leaves.static final byte[]Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 and 2 for 1, and 0 and 1 for 2.random seed for GenBigTreedoubleintCurrently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees.Reference to the World object.Fields inherited from class api.world.feature.AbstractTreeGrower
maxTreeHeight, minTreeHeight, name, woodType -
Constructor Summary
ConstructorsConstructorDescriptionBigTreeGrower(String name, int minTreeHeight, int maxTreeHeight, TreeGrowers.TreeWoodType woodType) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintcheckBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger) Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered.voidgenerateLeafNode(int par1, int par2, int par3, boolean isWorldGen) Generates the leaves surrounding an individual entry in the leafNodes list.voidgenerateLeafNodeBases(boolean isWorldGen) Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade.voidGenerates a list of leaf nodes for the tree, to be populated by generateLeaves.voidgenerateLeaves(boolean isWorldGen) Generates the leaf portion of the tree as specified by the leafNodes list.voidgenerateTrunk(boolean isWorldGen) Places the trunk for the big tree that is being generated.voidgenTreeLayer(int par1, int par2, int par3, float par4, byte par5, int blockID, int metadata, boolean isWorldGen) booleanfloatlayerSize(int par1) Gets the rough size of a layer of the tree.booleanleafNodeNeedsBase(int par1) Indicates whether or not a leaf node requires additional wood to be added to preserve integrity.floatleafSize(int par1) voidplaceBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, int blockID, int metadata, boolean isWorldGen) Places a line of the specified block ID into the world from the first coordinate triplet to the second.voidsetScale(double par1, double par3, double par5) Rescales the generator settings, only used in WorldGenBigTreeMethods inherited from class api.world.feature.AbstractTreeGrower
isLogReplaceable, isReplaceable, setBlock, setBlockAndMetadata
-
Field Details
-
otherCoordPairs
public static final byte[] otherCoordPairsContains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 and 2 for 1, and 0 and 1 for 2. -
rand
random seed for GenBigTree -
worldObj
Reference to the World object. -
basePos
public int[] basePos -
heightLimit
public int heightLimit -
height
public int height -
heightAttenuation
public double heightAttenuation -
branchSlope
public double branchSlope -
scaleWidth
public double scaleWidth -
leafDensity
public double leafDensity -
trunkSize
public int trunkSizeCurrently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. -
heightLimitLimit
public int heightLimitLimitSets the limit of the random value used to initialize the height limit. -
leafDistanceLimit
public int leafDistanceLimitSets the distance limit for how far away the generator will populate leaves from the base leaf node. -
leafNodes
public int[][] leafNodesContains a list of a points at which to generate groups of leaves.
-
-
Constructor Details
-
BigTreeGrower
public BigTreeGrower(String name, int minTreeHeight, int maxTreeHeight, TreeGrowers.TreeWoodType woodType)
-
-
Method Details
-
growTree
- Specified by:
growTreein classAbstractTreeGrower
-
canTreeGrowHere
protected boolean canTreeGrowHere() -
generateLeafNodeList
public void generateLeafNodeList()Generates a list of leaf nodes for the tree, to be populated by generateLeaves. -
genTreeLayer
public void genTreeLayer(int par1, int par2, int par3, float par4, byte par5, int blockID, int metadata, boolean isWorldGen) -
layerSize
public float layerSize(int par1) Gets the rough size of a layer of the tree. -
leafSize
public float leafSize(int par1) -
generateLeafNode
public void generateLeafNode(int par1, int par2, int par3, boolean isWorldGen) Generates the leaves surrounding an individual entry in the leafNodes list. -
placeBlockLine
public void placeBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, int blockID, int metadata, boolean isWorldGen) Places a line of the specified block ID into the world from the first coordinate triplet to the second. -
generateLeaves
public void generateLeaves(boolean isWorldGen) Generates the leaf portion of the tree as specified by the leafNodes list. -
leafNodeNeedsBase
public boolean leafNodeNeedsBase(int par1) Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. -
generateTrunk
public void generateTrunk(boolean isWorldGen) Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a field that is always 1 to 2. -
generateLeafNodeBases
public void generateLeafNodeBases(boolean isWorldGen) Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. -
checkBlockLine
public int checkBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger) Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. -
setScale
public void setScale(double par1, double par3, double par5) Rescales the generator settings, only used in WorldGenBigTree
-