properly implement caching getColumn

This commit is contained in:
dfsek
2022-06-11 21:16:46 -07:00
parent db61729e11
commit 1aa0c715b9
3 changed files with 8 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ public class BiomeExtrusionProvider implements BiomeProvider {
}
@Override
public Column<Biome> getColumn(int x, int z, WorldProperties properties) {
return new ExtrusionColumn(properties, this, x, z, properties.getSeed());
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
return new ExtrusionColumn(min, max, this, x, z, seed);
}
}

View File

@@ -14,13 +14,13 @@ public class ExtrusionColumn implements Column<Biome> {
private final long seed;
private final Column<Biome> delegate;
public ExtrusionColumn(WorldProperties worldProperties, BiomeExtrusionProvider provider, int x, int z, long seed) {
this.min = worldProperties.getMinHeight();
this.max = worldProperties.getMaxHeight();
public ExtrusionColumn(int min, int max, BiomeExtrusionProvider provider, int x, int z, long seed) {
this.min = min;
this.max = max;
this.provider = provider;
this.x = x;
this.z = z;
this.seed = worldProperties.getSeed();
this.seed = seed;
this.delegate = provider.getDelegate().getColumn(x, z, seed, min, max);
}

View File

@@ -106,8 +106,8 @@ public class BiomePipelineProvider implements BiomeProvider {
}
@Override
public Column<Biome> getColumn(int x, int z, WorldProperties properties) {
return new BiomePipelineColumn(this, properties.getMinHeight(), properties.getMaxHeight(), x, z, properties.getSeed());
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
return new BiomePipelineColumn(this, min, max, x, z, seed);
}
private record SeededVector(int x, int z, long seed) {