Advertisement
Guest User

Untitled

a guest
Jun 11th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.40 KB | None | 0 0
  1. package FoodPlus;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.minecraft.block.Block;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.util.MathHelper;
  9. import net.minecraft.world.ColorizerFoliage;
  10. import net.minecraft.world.ColorizerGrass;
  11. import net.minecraft.world.World;
  12. import net.minecraft.world.biome.BiomeDecorator;
  13. import net.minecraft.world.biome.BiomeGenBase;
  14. import net.minecraft.world.chunk.IChunkProvider;
  15. import net.minecraft.world.gen.feature.WorldGenFlowers;
  16. import net.minecraft.world.gen.feature.WorldGenMinable;
  17. import net.minecraftforge.common.MinecraftForge;
  18. import net.minecraftforge.event.terraingen.BiomeEvent;
  19. import cpw.mods.fml.common.IWorldGenerator;
  20. import cpw.mods.fml.relauncher.Side;
  21. import cpw.mods.fml.relauncher.SideOnly;
  22.  
  23. public class WorldGenerator implements IWorldGenerator{
  24.    
  25.     private int blockX;
  26.     private int blockZ;
  27.  
  28.     @Override
  29.     public void generate(Random random, int chunkX, int chunkZ, World world,IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
  30.        
  31.         switch(world.provider.dimensionId){
  32.             case 1:
  33.                 generateNether(world, random, chunkX * 16, chunkZ * 16);
  34.             case 0:
  35.                 generateSurface(world, random, chunkX * 16, chunkZ * 16);
  36.             case -1:
  37.                 generateEnd(world, random, chunkX * 16, chunkZ * 16);
  38.         }
  39.        
  40.     }
  41.    
  42.     private void generateEnd(World world, Random random, int chunkX, int chunkZ){
  43.        
  44.         }
  45.    
  46.     private void generateSurface(World world, Random random, int chunkX,int chunkZ){
  47.        
  48.         BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);
  49.         if(b.biomeName.equals("Ocean")) {
  50.            
  51.         for(int i = 0; i <10; i++){
  52.             int xCoord = chunkX + random.nextInt(16);
  53.             int yCoord = random.nextInt(64);
  54.             int zCoord = chunkZ + random.nextInt(16);
  55.            
  56.             (new WorldGenMinable(FoodPlus.SaltOre.blockID, 10)).generate(world, random, xCoord, yCoord, zCoord);
  57.        
  58.           }
  59.        
  60.         if world.getBlockId(x,y+1,z) == Block.waterStill.blockID;
  61.         for(int i = 0; i <10; i++){
  62.             int xCoord = chunkX + random.nextInt(16);
  63.             int yCoord = random.nextInt(64);
  64.             int zCoord = chunkZ + random.nextInt(16);
  65.            
  66.             (new WorldGenFlowers(FoodPlus.Seaweed.blockID)).generate(world, random, xCoord, yCoord, zCoord);
  67.      }
  68.      }
  69.      }
  70.    
  71.    
  72.     private void generateNether(World world, Random random, int chunkX, int chunkZ){
  73.        
  74.     }
  75.    
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement