mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-14 11:46:06 +00:00
use column in ChunkInterpolator
This commit is contained in:
@@ -70,7 +70,11 @@ public interface BiomeProvider {
|
||||
|
||||
|
||||
default Column<Biome> getColumn(int x, int z, WorldProperties properties) {
|
||||
return new BiomeColumn(this, properties.getMinHeight(), properties.getMaxHeight(), x, z, properties.getSeed());
|
||||
return getColumn(x, z, properties.getSeed(), properties.getMinHeight(), properties.getMaxHeight());
|
||||
}
|
||||
|
||||
default Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
|
||||
return new BiomeColumn(this, min, max, x, z, seed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ public class CachingBiomeProvider implements BiomeProvider, Handle {
|
||||
private final int minY;
|
||||
private final int maxY;
|
||||
private final Map<Long, Biome[]> cache = new HashMap<>();
|
||||
private final Map<Long, Column<Biome>> columnCache = new HashMap<>();
|
||||
|
||||
protected CachingBiomeProvider(BiomeProvider delegate, int minY, int maxY) {
|
||||
this.delegate = delegate;
|
||||
@@ -51,8 +52,8 @@ public class CachingBiomeProvider implements BiomeProvider, Handle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Column<Biome> getColumn(int x, int z, WorldProperties properties) {
|
||||
return delegate.getColumn(x, z, properties);
|
||||
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
|
||||
return columnCache.computeIfAbsent(MathUtil.squash(x, z), k -> delegate.getColumn(x, z, seed, min, max));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user