Advertisement
circuitdh

WorldGenChlorineBlock

Oct 1st, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. package bleachcraft.worldGen;
  2.  
  3.  
  4. import java.util.Random;
  5.  
  6. import net.minecraft.block.state.IBlockState;
  7. import net.minecraft.init.Blocks;
  8. import net.minecraft.util.math.BlockPos;
  9. import net.minecraft.world.World;
  10. import net.minecraft.world.chunk.IChunkGenerator;
  11. import net.minecraft.world.chunk.IChunkProvider;
  12. import net.minecraft.world.gen.feature.WorldGenMinable;
  13. import net.minecraftforge.fml.common.IWorldGenerator;
  14.  
  15. public class WorldGenChlorineBlock implements IWorldGenerator
  16. {
  17.     @Override
  18.     public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
  19.         switch(world.provider.getDimension()){
  20.             case 0:
  21.                 generateSurface(world, random, chunkX*16, chunkZ*16);
  22.             break; 
  23.         }
  24.     }
  25.  
  26.     private void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
  27.         for (int i = 0; i < 2; i++){
  28.             int randPosXX = chunkX + rand.nextInt(16);
  29.             int randPosYY = rand.nextInt(48);
  30.             int randPosZZ = chunkZ + rand.nextInt(16);
  31.            
  32.             BlockPos pos = new BlockPos(randPosXX,randPosYY,randPosZZ);
  33.             IBlockState state = bleachcraft.fluids.ChlorineBlock.instance.getDefaultState();
  34.            
  35.             new WorldGenMinable(state, 10).generate(world, rand, pos);
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement