Search in sources :

Example 11 with BiomeGenBase

use of net.minecraft.world.biome.BiomeGenBase in project MineFactoryReloaded by powercrystals.

the class MineFactoryReloadedWorldGen method generate.

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    if (_blacklistedDimensions == null) {
        _blacklistedDimensions = buildBlacklistedDimensions();
    }
    if (_blacklistedDimensions.contains(world.provider.dimensionId)) {
        return;
    }
    int x = chunkX * 16 + random.nextInt(16);
    int z = chunkZ * 16 + random.nextInt(16);
    BiomeGenBase b = world.getBiomeGenForCoords(x, z);
    if (MFRConfig.rubberTreeWorldGen.getBoolean(true)) {
        if (MFRRegistry.getRubberTreeBiomes().contains(b.biomeName)) {
            if (random.nextInt(100) < 40) {
                new WorldGenRubberTree().generate(world, random, x, random.nextInt(3) + 4, z);
            }
        }
    }
    if (MFRConfig.mfrLakeWorldGen.getBoolean(true) && world.provider.canRespawnHere()) {
        if (random.nextInt(MFRConfig.mfrLakeSludgeRarity.getInt()) == 0) {
            int lakeX = x - 8 + random.nextInt(16);
            int lakeY = random.nextInt(128);
            int lakeZ = z - 8 + random.nextInt(16);
            new WorldGenLakesMeta(MineFactoryReloadedCore.sludgeLiquid.blockID, 7).generate(world, random, lakeX, lakeY, lakeZ);
        }
        if (random.nextInt(MFRConfig.mfrLakeSewageRarity.getInt()) == 0) {
            int lakeX = x - 8 + random.nextInt(16);
            int lakeY = random.nextInt(128);
            int lakeZ = z - 8 + random.nextInt(16);
            if (b.biomeName.toLowerCase().contains("mushroom")) {
                new WorldGenLakesMeta(MineFactoryReloadedCore.mushroomSoupLiquid.blockID, 7).generate(world, random, lakeX, lakeY, lakeZ);
            } else {
                new WorldGenLakesMeta(MineFactoryReloadedCore.sewageLiquid.blockID, 7).generate(world, random, lakeX, lakeY, lakeZ);
            }
        }
    }
}
Also used : BiomeGenBase(net.minecraft.world.biome.BiomeGenBase)

Example 12 with BiomeGenBase

use of net.minecraft.world.biome.BiomeGenBase 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)12 Type (net.minecraftforge.common.BiomeDictionary.Type)5 Block (net.minecraft.block.Block)2 Affinity (am2.api.spell.enums.Affinity)1 IModFix (com.dreammaster.modfixes.IModFix)1 OilGeneratorFix (com.dreammaster.modfixes.oilgen.OilGeneratorFix)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 Material (net.minecraft.block.material.Material)1 EntityItem (net.minecraft.entity.item.EntityItem)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1 Vec3 (net.minecraft.util.Vec3)1 World (net.minecraft.world.World)1 WorldType (net.minecraft.world.WorldType)1 WorldGenFlowers (net.minecraft.world.gen.feature.WorldGenFlowers)1 LiquidStack (net.minecraftforge.liquids.LiquidStack)1