DialUp

WorldGeneratorEbonyTree

Jan 2nd, 2015
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.77 KB | None | 0 0
  1. package net.brandoncow.mod.worldGen;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.brandoncow.mod.world.EbonyWorldGenTrees;
  6. import net.minecraft.block.Block;
  7. import net.minecraft.world.World;
  8. import net.minecraft.world.chunk.IChunkProvider;
  9. import net.minecraft.world.gen.feature.WorldGenMinable;
  10. import cpw.mods.fml.common.IWorldGenerator;
  11.  
  12. public class WorldGeneratorEbonyTree implements IWorldGenerator {
  13.    
  14.     @Override
  15.     public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
  16.         switch(world.provider.dimensionId){
  17.             case -1:
  18.                 generateNether(world, random, chunkX*16, chunkZ*16);
  19.             case 0:
  20.                 generateSurface(world, random, chunkX*16, chunkZ*16);
  21.             case 1:
  22.                 generateEnd(world, random, chunkX*16, chunkZ*16);
  23.         }
  24.     }
  25.    
  26.     private void generateNether(World world, Random random, int x, int y){
  27.        
  28.     }
  29.    
  30.  
  31.     private void generateSurface(World world, Random random, int i, int j){
  32.         for(int t =0; t < 25; t++){
  33.             int chunkX = i + random.nextInt(16);
  34.             int chunkY =  random.nextInt(90);
  35.             int chunkZ = j + random.nextInt(16);
  36.            
  37.             (new EbonyWorldGenTrees(false, 10, 0, 0, false)).generate(world, random, chunkX, chunkY, chunkZ);
  38.         }
  39.     }
  40.    
  41.     private void generateEnd(World world, Random random, int x, int y){
  42.        
  43.     }
  44.    
  45.     public void AddOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY){
  46.         for(int i = 0; i < chancesToSpawn; i++){
  47.             int posX = blockXPos + random.nextInt(maxX);
  48.             int posY = minY + random.nextInt(maxY - minY);
  49.             int posZ = blockZPos + random.nextInt(maxZ);
  50.             (new WorldGenMinable(block.blockID, maxVeinSize)).generate(world, random, posX, posY, posZ);
  51.     }
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment