use of forestry.api.arboriculture.IGrowthProvider in project ForestryMC by ForestryMC.
the class TreeDecorator method generateBiomeCache.
private static void generateBiomeCache(World world, Random rand) {
for (IAlleleTreeSpecies species : getSpecies()) {
IAllele[] template = TreeManager.treeRoot.getTemplate(species);
ITreeGenome genome = TreeManager.treeRoot.templateAsGenome(template);
ITree tree = TreeManager.treeRoot.getTree(world, genome);
IGrowthProvider growthProvider = species.getGrowthProvider();
for (Biome biome : Biome.REGISTRY) {
Set<ITree> trees = biomeCache.computeIfAbsent(biome.getRegistryName(), k -> new HashSet<>());
if (growthProvider.isBiomeValid(tree, biome)) {
trees.add(tree);
}
}
}
}
Aggregations