Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WorldGenBurnedTree extends WorldGenAbstractTree{
- public WorldGenBurnedTree(boolean notify) {
- super(notify);
- }
- public static final IBlockState TRUNK = BlockInit.BURNED_LOG.getDefaultState();
- public boolean generate(World worldIn, Random rand, BlockPos base) {
- int trunkHeight = rand.nextInt(4) + 3;
- for (int i = 0; i < trunkHeight; i++) {
- if (!(worldIn.getBlockState(new BlockPos(base.getX(), base.getY() + i + 1, base.getZ())).equals(Blocks.AIR.getDefaultState()))) {
- return false;
- }
- }
- for (int i = 0; i < trunkHeight; i++) {
- world.setBlockState(new BlockPos(base.getX(), base.getY() + i + 1, base.getZ()), TRUNK);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement