use of forestry.arboriculture.worldgen.WorldGenArboriculture in project ForestryMC by ForestryMC.
the class TileSapling method canAcceptBoneMeal.
public boolean canAcceptBoneMeal(Random rand) {
ITree tree = getTree();
if (tree == null) {
return false;
}
int maturity = getRequiredMaturity(world, tree);
if (timesTicked < maturity) {
return true;
}
WorldGenerator generator = tree.getTreeGenerator(world, getPos(), true);
if (generator instanceof WorldGenArboriculture) {
WorldGenArboriculture arboricultureGenerator = (WorldGenArboriculture) generator;
arboricultureGenerator.preGenerate(world, rand, getPos());
return arboricultureGenerator.getValidGrowthPos(world, getPos()) != null;
} else {
return true;
}
}
Aggregations