use of net.minecraft.world.level.levelgen.feature.stateproviders.WeightedStateProvider in project Tropicraft by Tropicraft.
the class TropicraftTrees method createFruit.
private static AbstractTreeGrower createFruit(Supplier<? extends Block> fruitLeaves, Supplier<Supplier<? extends Block>> fruitSapling) {
return create((server, random, beehive) -> {
WeightedStateProvider leaves = new WeightedStateProvider(SimpleWeightedRandomList.<BlockState>builder().add(TropicraftBlocks.FRUIT_LEAVES.get().defaultBlockState(), 1).add(fruitLeaves.get().defaultBlockState(), 1));
TreeConfiguration config = new TreeConfiguration.TreeConfigurationBuilder(new SimpleStateProvider(Blocks.OAK_LOG.defaultBlockState()), new CitrusTrunkPlacer(6, 3, 0), leaves, new SimpleStateProvider(fruitSapling.get().get().defaultBlockState()), new CitrusFoliagePlacer(ConstantInt.of(0), ConstantInt.of(0)), new TwoLayersFeatureSize(1, 0, 2)).build();
return Feature.TREE.configured(config);
});
}
Aggregations