package com.yolp900.itsjustacharm.common.blocks; import com.yolp900.itsjustacharm.api.IJCConstants; import com.yolp900.itsjustacharm.common.blocks.base.ModBlockSapling; import com.yolp900.itsjustacharm.common.world.TintedTreeGenerator; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.event.terraingen.TerrainGen; import javax.annotation.Nonnull; import java.util.Random; public class BlockTintedSapling extends ModBlockSapling { public BlockTintedSapling() { super(IJCConstants.Blocks.TintedSapling); } @Override public void generateTree(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Random rand) { if (!TerrainGen.saplingGrowTree(world, rand, pos)) return; TintedTreeGenerator gen = new TintedTreeGenerator(); world.setBlockToAir(pos); gen.generateTree(rand, world, pos); } }