Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.X39.mods.minecraft.tecmod.startPack;
- import java.util.Random;
- 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 ModWorldGen implements IWorldGenerator {
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
- switch(world.provider.dimensionId) {
- case -1:
- generateNether();
- break;
- case 0:
- generateSurface(world, random, chunkX*16, chunkZ*16);
- break;
- case 1:
- generateEnd();
- break;
- }
- }
- public void generateNether() {
- }
- public void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
- if (rand.nextInt(10) == 5)
- for (int i = 0; i < 5; i++) {
- int randPosX = chunkX + rand.nextInt(16);
- int randPosY = rand.nextInt(32);
- int randPosZ = chunkZ + rand.nextInt(16);
- // System.out.println(randPosX + " - " + randPosY + " - " + randPosZ);
- (new WorldGenMinable(ModBlocks.UraniumOre.blockID, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
- }
- for (int i = 0; i < 6; i++) {
- int randPosX = chunkX + rand.nextInt(16);
- int randPosY = rand.nextInt(40);
- int randPosZ = chunkZ + rand.nextInt(16);
- // System.out.println(randPosX + " - " + randPosY + " - " + randPosZ);
- (new WorldGenMinable(ModBlocks.CopperOre.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
- }
- for (int i = 0; i < 4; i++) {
- int randPosX = chunkX + rand.nextInt(16);
- int randPosY = rand.nextInt(20);
- int randPosZ = chunkZ + rand.nextInt(16);
- // System.out.println(randPosX + " - " + randPosY + " - " + randPosZ);
- (new WorldGenMinable(ModBlocks.TeridiumOre.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
- }
- }
- public void generateEnd() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement