Advertisement
circuitdh

WorldGenChlorineBlock

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