mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-12 10:46:25 +00:00
properly implement caching getColumn
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user