Search in sources :

Example 1 with VanillaDecorationGeneration

use of ivorius.reccomplex.world.gen.feature.structure.generic.generation.VanillaDecorationGeneration in project RecurrentComplex by Ivorforce.

the class RCBiomeDecorator method doDecorate.

protected static int doDecorate(WorldServer worldIn, Random random, BlockPos blockPos, DecorationType type, int amount, boolean lowChance) {
    ChunkPos chunkPos = new ChunkPos(blockPos);
    double baseWeight = RCConfig.baseDecorationWeights.get(type);
    if (baseWeight <= 0)
        return amount;
    Biome biomeIn = worldIn.getBiome(chunkPos.getBlock(16, 0, 16));
    StructureSelector<VanillaDecorationGeneration, DecorationType> selector = StructureRegistry.INSTANCE.decorationSelectors().get(biomeIn, worldIn.provider);
    double totalWeight = selector.totalWeight(type);
    if (totalWeight <= 0)
        return amount;
    return trySurface(worldIn, random, chunkPos, selector, type, totalWeight, baseWeight, amount, lowChance);
}
Also used : Biome(net.minecraft.world.biome.Biome) VanillaDecorationGeneration(ivorius.reccomplex.world.gen.feature.structure.generic.generation.VanillaDecorationGeneration) ChunkPos(net.minecraft.util.math.ChunkPos)

Aggregations

VanillaDecorationGeneration (ivorius.reccomplex.world.gen.feature.structure.generic.generation.VanillaDecorationGeneration)1 ChunkPos (net.minecraft.util.math.ChunkPos)1 Biome (net.minecraft.world.biome.Biome)1