Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package na_t.example.testmod;
- import java.util.Random;
- import net.minecraft.block.Block;
- import net.minecraft.world.World;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.feature.WorldGenMinable;
- import cpw.mods.fml.common.IWorldGenerator;
- public class OreGenerator implements IWorldGenerator {
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world,
- IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
- {
- switch(world.provider.dimensionId)
- {
- case -1 :
- generateInNether(world,random, chunkX*16, chunkZ*16);
- break;
- case 0 :
- generateInOverworld(world,random, chunkX*16, chunkZ*16);
- break;
- case 1 :
- generateInEnd(world,random, chunkX*16, chunkZ*16);
- break;
- }
- }
- public void generateInEnd(World world, Random random, int x, int y)
- {
- }
- public void generateInOverworld(World world, Random random, int x, int z)
- {
- for(int i=0; i<25; i++) {
- int xcoord = x + random.nextInt(16);
- int ycoord = random.nextInt(32);
- int zcoord = z + random.nextInt(16);
- new WorldGenMinable(Generic.testoniumOre, 8).generate(world, random, xcoord, ycoord, zcoord);
- }
- }
- public void generateInNether(World world, Random random, int x, int y)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment