Search in sources :

Example 1 with WorldGenBigTrees

use of betterwithaddons.world.WorldGenBigTrees in project BetterWithAddons by DaedalusGame.

the class BlockModSapling method generateTree.

public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) {
    if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos))
        return;
    WorldGenerator worldgenerator = isBig ? new WorldGenBigTrees(true, log, leaves, this) : new WorldGenTrees(true, 3, log, leaves, false);
    int i = 0;
    int j = 0;
    IBlockState iblockstate2 = Blocks.AIR.getDefaultState();
    worldIn.setBlockState(pos, iblockstate2, 4);
    if (!worldgenerator.generate(worldIn, rand, pos.add(i, 0, j))) {
        worldIn.setBlockState(pos, state, 4);
    }
}
Also used : WorldGenerator(net.minecraft.world.gen.feature.WorldGenerator) IBlockState(net.minecraft.block.state.IBlockState) WorldGenBigTrees(betterwithaddons.world.WorldGenBigTrees) WorldGenTrees(net.minecraft.world.gen.feature.WorldGenTrees)

Aggregations

WorldGenBigTrees (betterwithaddons.world.WorldGenBigTrees)1 IBlockState (net.minecraft.block.state.IBlockState)1 WorldGenTrees (net.minecraft.world.gen.feature.WorldGenTrees)1 WorldGenerator (net.minecraft.world.gen.feature.WorldGenerator)1