Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.endernoobs.rpgmod;
- import java.util.Random;
- import cpw.mods.fml.common.IWorldGenerator;
- import net.minecraft.init.Blocks;
- import net.minecraft.world.World;
- import net.minecraft.world.biome.BiomeGenBase;
- import net.minecraft.world.chunk.IChunkProvider;
- public class WorldGenerator implements IWorldGenerator {
- public void generate(Random random, int chunkX, int chunkZ, World world,
- IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
- switch (world.provider.dimensionId) {
- case -1:
- generateNether(world, random, chunkX * 16, chunkZ * 16);
- case 0:
- generateSurface(world, random, chunkX * 16, chunkZ * 16);
- }
- }
- public void generateHauntedHouse(World world, Random random, int i, int j,
- int k) {
- }
- Random r = new Random();
- private void generateSurface(World world, Random random, int blockX,
- int blockZ) {
- float chance = r.nextFloat();
- BiomeGenBase b = world.getBiomeGenForCoords(blockX, blockZ);
- if (chance <= 0.01f) {
- if (b.biomeName.equals("Plains")) {
- int i = blockX + random.nextInt(16);
- int j = random.nextInt(80);
- int k = blockZ + random.nextInt(16);
- (new WorldGenHauntedHouse()).generate(world, random, i, j, k);
- }
- }
- }
- private void generateNether(World world, Random random, int blockX,
- int blockZ) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement