remove unused random parameter from populators

This commit is contained in:
dfsek
2021-01-07 10:33:23 -07:00
parent e47b3f0397
commit 64391f3abc
11 changed files with 28 additions and 28 deletions
@@ -30,9 +30,7 @@ public interface ChunkGenerator extends Handle {
@Nullable
TerraChunkGenerator getTerraGenerator();
interface ChunkData {
Object getHandle();
interface ChunkData extends Handle {
/**
* Get the maximum height for the chunk.
* <p>
@@ -3,8 +3,6 @@ package com.dfsek.terra.api.world.generation;
import com.dfsek.terra.api.platform.world.Chunk;
import com.dfsek.terra.api.platform.world.World;
import java.util.Random;
public interface TerraBlockPopulator {
void populate(World world, Random random, Chunk chunk);
void populate(World world, Chunk chunk);
}
@@ -34,14 +34,14 @@ public class PopulationManager implements TerraBlockPopulator {
@Override
@SuppressWarnings("try")
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
public void populate(@NotNull World world, @NotNull Chunk chunk) {
try(ProfileFuture ignored = measure()) {
needsPop.add(new ChunkCoordinate(chunk));
int x = chunk.getX();
int z = chunk.getZ();
if(main.isEnabled()) {
for(int xi = - 1; xi <= 1; xi++) {
for(int zi = - 1; zi <= 1; zi++) {
for(int xi = -1; xi <= 1; xi++) {
for(int zi = -1; zi <= 1; zi++) {
if(xi == 0 && zi == 0) continue;
if(world.isChunkGenerated(xi + x, zi + z)) checkNeighbors(xi + x, zi + z, world);
}
@@ -86,7 +86,7 @@ public class PopulationManager implements TerraBlockPopulator {
random.setSeed((long) x * xRand + (long) z * zRand ^ w.getSeed());
Chunk currentChunk = w.getChunkAt(x, z);
for(TerraBlockPopulator r : attachedPopulators) {
r.populate(w, random, currentChunk);
r.populate(w, currentChunk);
}
needsPop.remove(c);
}