use column in ChunkInterpolator

This commit is contained in:
dfsek
2022-06-11 02:27:45 -07:00
parent c9221ca64c
commit ad5435f69d
5 changed files with 34 additions and 11 deletions
@@ -42,6 +42,13 @@ public class BiomeExtrusionProvider implements BiomeProvider {
return delegate.getBaseBiome(x, z, seed);
}
public Biome getBiome(int x, int y, int z, long seed, Biome biome) {
for(Extrusion extrusion : extrusions) {
biome = extrusion.extrude(biome, x, y, z, seed);
}
return biome;
}
@Override
public Iterable<Biome> getBiomes() {
return biomes;
@@ -51,8 +58,12 @@ public class BiomeExtrusionProvider implements BiomeProvider {
return resolution;
}
public BiomeProvider getDelegate() {
return delegate;
}
@Override
public Column<Biome> getColumn(int x, int z, WorldProperties properties) {
return new ExtrusionColumn(properties, this, x, z);
return new ExtrusionColumn(properties, this, x, z, properties.getSeed());
}
}
@@ -12,14 +12,16 @@ public class ExtrusionColumn implements Column<Biome> {
private final BiomeExtrusionProvider provider;
private final int x, z;
private final long seed;
private final Column<Biome> delegate;
public ExtrusionColumn(WorldProperties worldProperties, BiomeExtrusionProvider provider, int x, int z) {
public ExtrusionColumn(WorldProperties worldProperties, BiomeExtrusionProvider provider, int x, int z, long seed) {
this.min = worldProperties.getMinHeight();
this.max = worldProperties.getMaxHeight();
this.provider = provider;
this.x = x;
this.z = z;
this.seed = worldProperties.getSeed();
this.delegate = provider.getDelegate().getColumn(x, z, seed, min, max);
}
@Override
@@ -44,7 +46,7 @@ public class ExtrusionColumn implements Column<Biome> {
@Override
public Biome get(int y) {
return provider.getBiome(x, y, z, seed);
return provider.getBiome(x, y, z, seed, delegate.get(y));
}
@Override