mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
BlockPopulator -> GenerationStage
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user