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 id;
14         private int meta;
15         private int size;
16         private int frequency;
17         private int posY;
18
19         public WorldGenAtomsOre(int id, int size, int frequency, int posY)
20         {
21                 super(id, size);
22                 this.frequency = frequency;
23                 this.posY = posY;
24         }
25
26         public WorldGenAtomsOre(int id, int meta, int size, int frequency, int posY)
27         {
28                 this(id, size, frequency, posY);
29                 this.meta = meta;
30         }
31
32         @Override
33         public void generate(Random par1Random, int par2ChunkX, int par3ChunkZ, World par4World, IChunkProvider par5ChunkGenerator, IChunkProvider par6ChunkProvider)
34         {
35                 for (int i = 0; i < this.frequency; i++) {
36                         this.generate(par4World, par1Random, par2ChunkX * 16 + par1Random.nextInt(16), par1Random.nextInt(this.posY), par3ChunkZ * 16 + par1Random.nextInt(16));
37                 }
38         }
39
40 }