BlockPopulator -> GenerationStage

This commit is contained in:
dfsek
2021-07-08 09:56:19 -07:00
parent 719ea83bcd
commit 8dcd50d3fb
18 changed files with 33 additions and 33 deletions

View File

@@ -19,7 +19,7 @@ public class BukkitPopulatorWrapper extends BlockPopulator {
@Override
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk source) {
delegate.getPopulators().forEach(populator -> {
delegate.getGenerationStages().forEach(populator -> {
if(populator instanceof Chunkified) {
populator.populate(BukkitAdapter.adapt(world), BukkitAdapter.adapt(source));
}

View File

@@ -64,7 +64,7 @@ public class PopulationManager extends BlockPopulator {
long zRand = (random.nextLong() / 2L << 1L) + 1L;
random.setSeed((long) x * xRand + (long) z * zRand ^ w.getSeed());
Chunk currentChunk = w.getChunkAt(x, z);
generator.getPopulators().forEach(populator -> {
generator.getGenerationStages().forEach(populator -> {
if(!(populator instanceof Chunkified)) {
populator.populate(w, currentChunk);
}

View File

@@ -146,7 +146,7 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements Gener
return CompletableFuture.supplyAsync(() -> {
World world = (World) ((StructureAccessorAccessor) accessor).getWorld();
delegate.generateChunkData(world, new FastRandom(), chunk.getPos().x, chunk.getPos().z, (ChunkData) chunk);
delegate.getPopulators().forEach(populator -> {
delegate.getGenerationStages().forEach(populator -> {
if(populator instanceof Chunkified) {
populator.populate(world, (com.dfsek.terra.api.world.Chunk) world);
}

View File

@@ -24,7 +24,7 @@ public class PopulatorFeature extends Feature<DefaultFeatureConfig> {
if(!(chunkGenerator instanceof FabricChunkGeneratorWrapper)) return true;
StructureWorldAccess world = context.getWorld();
FabricChunkGeneratorWrapper gen = (FabricChunkGeneratorWrapper) chunkGenerator;
gen.getHandle().getPopulators().forEach(populator -> {
gen.getHandle().getGenerationStages().forEach(populator -> {
if(!(populator instanceof Chunkified)) {
populator.populate((World) world, (Chunk) world);
}