Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mod.serveur.world;
- import java.util.Random;
- import com.mod.serveur.init.BlockMod;
- import cpw.mods.fml.common.IWorldGenerator;
- import net.minecraft.block.Block;
- import net.minecraft.init.Blocks;
- import net.minecraft.world.World;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.feature.WorldGenMinable;
- public class WorldGenMod 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(world, chunkX * 16, chunkZ * 16, random);
- break;
- case 0:
- GenerateOverWorld(world, chunkX * 16, chunkZ * 16, random);
- break;
- case 1:
- GenerateEnd(world, chunkX * 16, chunkZ * 16, random);
- break;
- }
- }
- private void addOre(Block block, Block blockspawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minV, int maxV, int spawnChance)
- {
- for(int i = 0; i < spawnChance; i++)
- {
- int chunkSize= 16;
- int Xpos = posX + random.nextInt(chunkSize);
- int Ypos = minY + random.nextInt(maxY - minY);
- int Zpos = posX + random.nextInt(chunkSize);
- new WorldGenMinable (block, maxV, blockspawn).generate(world, random, Xpos, Ypos, Zpos);
- }
- }
- private void GenerateNether(World world, int i, int j, Random random)
- {
- }
- private void GenerateOverWorld(World world, int i, int j, Random random)
- {
- addOre(BlockMod.jaspe_ore, Blocks.stone, random, world, i, j, 0, 9, 1, 4, 2);
- addOre(BlockMod.heliotrope_ore, Blocks.stone, random, world, i, j, 0, 18, 1, 8, 15);
- addOre(BlockMod.rubellite_ore, Blocks.stone, random, world, i, j, 0, 26, 1, 10, 20);
- addOre(BlockMod.sphene_ore, Blocks.stone, random, world, i, j, 0, 13, 1, 6, 5);
- System.out.println("generation");
- }
- private void GenerateEnd(World world, int i, int j, Random random)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement