Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mod.drakania.world;
- import java.util.Random;
- import com.mod.drakania.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 WorldGenDraka 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);
- case 0:
- GenerateOverWorld(world, chunkX * 16, chunkZ *16, random);
- case 1:
- Generateneend(world, chunkX * 16, chunkZ *16, random);
- }
- }
- 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 = posZ + random.nextInt(ChunkSize);
- new WorldGenMinable(block, maxV) .generate(world, random, Xpos, Ypos, Zpos);
- }
- }
- private void Generateneend(World world, int i, int j, Random random)
- {
- }
- private void GenerateOverWorld(World world, int i, int j, Random random)
- {
- addOre(BlockMod.drakanium_ore, Blocks.stone, random, world, i, j, 0, 12, 1, 8, 100);
- addOre(BlockMod.crystallium_ore, Blocks.stone, random, world, i, j, 0, 12, 1, 2, 90);
- }
- private void GenerateNether(World world, int i, int j, Random random)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement