OSDN Git Service

?
[chemicraft/chemicraft.git] / common / pcc / chemicraft / gen / WorldGenAtomsOre.java
1 package pcc.chemicraft.gen;
2
3 import java.util.Random;
4
5 import net.minecraft.world.World;
6 import net.minecraft.world.chunk.IChunkProvider;
7 import net.minecraft.world.gen.feature.WorldGenMinable;
8 import cpw.mods.fml.common.IWorldGenerator;
9
10 public class WorldGenAtomsOre extends WorldGenMinable implements IWorldGenerator
11 {
12
13         private int frequency;
14         private int posY;
15
16         public WorldGenAtomsOre(int id, int meta, int size, int frequency, int posY)
17         {
18                 super(id, meta, size);
19                 this.frequency = frequency;
20                 this.posY = posY;
21         }
22
23         @Override
24         public void generate(Random par1Random, int par2ChunkX, int par3ChunkZ, World par4World, IChunkProvider par5ChunkGenerator, IChunkProvider par6ChunkProvider)
25         {
26                 for (int i = 0; i < this.frequency; i++) {
27                         this.generate(par4World, par1Random, par2ChunkX * 16 + par1Random.nextInt(16), par1Random.nextInt(this.posY), par3ChunkZ * 16 + par1Random.nextInt(16));
28                 }
29         }
30
31 }