mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 14:50:56 +00:00
properly clamp max Y in LazilyEvaluatedInterpolator
This commit is contained in:
+6
-3
@@ -23,7 +23,7 @@ public class LazilyEvaluatedInterpolator {
|
|||||||
private final PropertyKey<BiomeNoiseProperties> noisePropertiesKey;
|
private final PropertyKey<BiomeNoiseProperties> noisePropertiesKey;
|
||||||
|
|
||||||
private final long seed;
|
private final long seed;
|
||||||
private final int min;
|
private final int min, max;
|
||||||
|
|
||||||
private final int zMul, yMul;
|
private final int zMul, yMul;
|
||||||
public LazilyEvaluatedInterpolator(BiomeProvider biomeProvider, int cx, int cz, int max,
|
public LazilyEvaluatedInterpolator(BiomeProvider biomeProvider, int cx, int cz, int max,
|
||||||
@@ -42,6 +42,7 @@ public class LazilyEvaluatedInterpolator {
|
|||||||
this.biomeProvider = biomeProvider;
|
this.biomeProvider = biomeProvider;
|
||||||
this.seed = seed;
|
this.seed = seed;
|
||||||
this.min = min;
|
this.min = min;
|
||||||
|
this.max = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double sample(int xIndex, int yIndex, int zIndex, int ox, int oy, int oz) {
|
private double sample(int xIndex, int yIndex, int zIndex, int ox, int oy, int oz) {
|
||||||
@@ -51,12 +52,14 @@ public class LazilyEvaluatedInterpolator {
|
|||||||
int xi = ox + chunkX;
|
int xi = ox + chunkX;
|
||||||
int zi = oz + chunkZ;
|
int zi = oz + chunkZ;
|
||||||
|
|
||||||
|
int y = FastMath.min(max, oy);
|
||||||
|
|
||||||
sample = biomeProvider
|
sample = biomeProvider
|
||||||
.getBiome(xi, oy, zi, seed)
|
.getBiome(xi, y, zi, seed)
|
||||||
.getContext()
|
.getContext()
|
||||||
.get(noisePropertiesKey)
|
.get(noisePropertiesKey)
|
||||||
.carving()
|
.carving()
|
||||||
.noise(seed, xi, oy, zi);
|
.noise(seed, xi, y, zi);
|
||||||
samples[index] = sample;
|
samples[index] = sample;
|
||||||
}
|
}
|
||||||
return sample;
|
return sample;
|
||||||
|
|||||||
Reference in New Issue
Block a user