Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.reactioncraft.desert.common;
- import java.util.Random;
- import net.minecraft.block.BlockBush;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraft.world.gen.feature.WorldGenerator;
- public class WorldGenFlowerState extends WorldGenerator
- {
- private final IBlockState block;
- public WorldGenFlowerState(IBlockState blockIn)
- {
- this.block = blockIn;
- }
- public boolean generate(World worldIn, Random rand, BlockPos position)
- {
- for (int i = 0; i < 64; ++i)
- {
- BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
- if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky() || blockpos.getY() < worldIn.getHeight() - 1))
- {
- worldIn.setBlockState(blockpos, block, 2);
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement