Search in sources :

Example 1 with StaticGeneration

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

the class WorldGenStructures method planStaticStructuresInChunk.

public static void planStaticStructuresInChunk(Random random, ChunkPos chunkPos, WorldServer world, BlockPos spawnPos, @Nullable Predicate<Structure> structurePredicate) {
    StructureRegistry.INSTANCE.getStaticStructuresAt(chunkPos, world, spawnPos).forEach(triple -> {
        StaticGeneration staticGenInfo = triple.getMiddle();
        Structure<?> structure = triple.getLeft();
        BlockSurfacePos pos = triple.getRight();
        if (structurePredicate != null && !structurePredicate.test(structure))
            return;
        new StructureGenerator<>(structure).world(world).generationInfo(staticGenInfo).seed(random.nextLong()).randomPosition(pos, staticGenInfo.placer.getContents()).fromCenter(true).partially(RecurrentComplex.PARTIALLY_SPAWN_NATURAL_STRUCTURES, chunkPos).generate();
    });
}
Also used : StaticGeneration(ivorius.reccomplex.world.gen.feature.structure.generic.generation.StaticGeneration) BlockSurfacePos(ivorius.ivtoolkit.blocks.BlockSurfacePos)

Aggregations

BlockSurfacePos (ivorius.ivtoolkit.blocks.BlockSurfacePos)1 StaticGeneration (ivorius.reccomplex.world.gen.feature.structure.generic.generation.StaticGeneration)1