use of ivorius.reccomplex.world.gen.feature.selector.MixingStructureSelector in project RecurrentComplex by Ivorforce.
the class WorldGenStructures method planStructuresInChunk.
public static void planStructuresInChunk(Random random, ChunkPos chunkPos, WorldServer world, Biome biomeGen, @Nullable Predicate<Structure> structurePredicate) {
MixingStructureSelector<NaturalGeneration, NaturalStructureSelector.Category> structureSelector = NaturalGeneration.selectors(StructureRegistry.INSTANCE).get(biomeGen, world.provider);
float distanceToSpawn = distance(new ChunkPos(world.getSpawnPoint()), chunkPos);
// TODO Use STRUCTURE_TRIES
List<Pair<Structure<?>, NaturalGeneration>> generated = structureSelector.generatedStructures(random, world.getBiome(chunkPos.getBlock(0, 0, 0)), world.provider, distanceToSpawn);
generated.stream().filter(pair -> structurePredicate == null || structurePredicate.test(pair.getLeft())).forEach(pair -> planStructureInChunk(chunkPos, world, pair.getLeft(), pair.getRight(), random.nextLong()));
}
Aggregations