Search in sources :

Example 1 with WorldGenFlowers

use of net.minecraft.world.gen.feature.WorldGenFlowers in project BluePower by Qmunity.

the class WorldGenerationHandler method generate.

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    if (!world.provider.isSurfaceWorld()) {
        return;
    }
    if (Config.generateAmethyst) {
        addOreToGenerate(random, Config.veinCountAmethyst, Config.veinSizeAmethyst, Config.minAmethystY, Config.maxAmethystY, BPBlocks.amethyst_ore, world, chunkX, chunkZ);
    }
    if (Config.generateRuby) {
        addOreToGenerate(random, Config.veinCountRuby, Config.veinSizeRuby, Config.minRubyY, Config.maxRubyY, BPBlocks.ruby_ore, world, chunkX, chunkZ);
    }
    if (Config.generateSapphire) {
        addOreToGenerate(random, Config.veinCountSapphire, Config.veinSizeSapphire, Config.minSapphireY, Config.maxSapphireY, BPBlocks.sapphire_ore, world, chunkX, chunkZ);
    }
    if (Config.generateSilver) {
        addOreToGenerate(random, Config.veinCountSilver, Config.veinSizeSilver, Config.minSilverY, Config.maxSilverY, BPBlocks.silver_ore, world, chunkX, chunkZ);
    }
    if (Config.generateTeslatite) {
        addOreToGenerate(random, Config.veinCountTeslatite, Config.veinSizeTeslatite, Config.minTeslatiteY, Config.maxTeslatiteY, BPBlocks.teslatite_ore, world, chunkX, chunkZ);
    }
    if (Config.generateZinc) {
        addOreToGenerate(random, Config.veinCountZinc, Config.veinSizeZinc, Config.minZincY, Config.maxZincY, BPBlocks.zinc_ore, world, chunkX, chunkZ);
    }
    if (Config.generateCopper) {
        addOreToGenerate(random, Config.veinCountCopper, Config.veinSizeCopper, Config.minCopperY, Config.maxCopperY, BPBlocks.copper_ore, world, chunkX, chunkZ);
    }
    if (Config.generateTungsten) {
        addOreToGenerate(random, Config.veinCountTungsten, Config.veinSizeTungsten, Config.minTungstenY, Config.maxTungstenY, BPBlocks.tungsten_ore, world, chunkX, chunkZ);
    }
    BiomeGenBase bgb = world.getWorldChunkManager().getBiomeGenAt(chunkX * 16 + 16, chunkZ * 16 + 16);
    int n = 0;
    if (bgb == BiomeGenBase.birchForest)
        n = 1;
    else if (bgb == BiomeGenBase.birchForestHills)
        n = 1;
    else if (bgb == BiomeGenBase.plains)
        n = 1;
    else if (bgb == BiomeGenBase.forest)
        n = 4;
    else if (bgb == BiomeGenBase.roofedForest)
        n = 4;
    for (int i = 0; i < n; i++) {
        int x = chunkX * 16 + random.nextInt(16) + 8;
        int y = random.nextInt(128);
        int z = chunkZ * 16 + random.nextInt(16) + 8;
        new WorldGenFlowers(BPBlocks.indigo_flower).generate(world, random, x, y, z);
    }
    if (Config.veinSizeMarble > 0) {
        for (int i = 0; i < 4; i++) {
            int x = chunkX * 16 + random.nextInt(16);
            int y = 32 + random.nextInt(32);
            int z = chunkZ * 16 + random.nextInt(16);
            new WorldGenMarble(BPBlocks.marble, random.nextInt(Config.veinSizeMarble)).generate(world, random, x, y, z);
        }
    }
    if (random.nextDouble() < Config.volcanoSpawnChance) {
        int x = chunkX * 16 + random.nextInt(16);
        //20
        int z = chunkZ * 16 + random.nextInt(16);
        int y = world.getHeightValue(x, z) + 30 + random.nextInt(40);
        if (world.getBlock(x, 10, z) == Blocks.lava && world.getHeightValue(x, z) <= 90) {
            new WorldGenVolcano().generate(world, random, x, y, z);
        }
    }
}
Also used : WorldGenFlowers(net.minecraft.world.gen.feature.WorldGenFlowers) BiomeGenBase(net.minecraft.world.biome.BiomeGenBase)

Aggregations

BiomeGenBase (net.minecraft.world.biome.BiomeGenBase)1 WorldGenFlowers (net.minecraft.world.gen.feature.WorldGenFlowers)1