Package extrabiomes.module.summa.worldgen

Source Code of extrabiomes.module.summa.worldgen.EelGrassGenerator

/**
* This work is licensed under the Creative Commons
* Attribution-ShareAlike 3.0 Unported License. To view a copy of this
* license, visit http://creativecommons.org/licenses/by-sa/3.0/.
*/

package extrabiomes.module.summa.worldgen;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenerator;
import cpw.mods.fml.common.IWorldGenerator;
import extrabiomes.lib.BiomeSettings;

public class EelGrassGenerator implements IWorldGenerator
{
   
    private final WorldGenerator eelGrassGen;
   
    public EelGrassGenerator(Block block, int metaData)
    {
        eelGrassGen = new WorldGenEelGrass(block, metaData);
    }
   
    @Override
    public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
        chunkX = chunkX << 4;
        chunkZ = chunkZ << 4;
        final BiomeGenBase biome = world.getBiomeGenForCoords(chunkX, chunkX);
       
        for (int i = 0; i < 20; i++) {
            final int x = chunkX + rand.nextInt(16) + 8;
            final int z = chunkZ + rand.nextInt(16) + 8;
            final int y = world.getHeightValue(x, z);
            eelGrassGen.generate(world, rand, x, y, z);
        }
    }
}
TOP

Related Classes of extrabiomes.module.summa.worldgen.EelGrassGenerator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.