Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mightydanp.eot.api.common.world.gen.feature;
- import java.util.Random;
- import com.mightydanp.eot.common.block.ModBlocks;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraft.world.gen.feature.WorldGenerator;
- public class IWorldGenTwigs extends WorldGenerator{
- 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() < 255) && ModBlocks.twigs.canPlaceBlockAt(worldIn, blockpos))
- {
- worldIn.setBlockState(blockpos, ModBlocks.twigs.getDefaultState(), 2);
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment