mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 16:25:36 +00:00
Clamp vacuum targets to the dimension's own heights instead of Minecraft's range, so terrain can be raised past Y 256 in a dimension that starts at -64
This commit is contained in:
1 parent
c19f955fef
commit
162d4d0be8
2 files changed
+12
-5
No files matched your search
@@ -93,6 +93,13 @@ public final class IrisObjectVacuum {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** The lowest height vacuum may target, one above the dimension's bottom (placer heights start at 0 there). */
|
||||
public static final int LOWEST_TARGET_Y = 1;
|
||||
|
||||
public static int clampTargetY(int targetY, int lowestY, int highestY) {
|
||||
return Math.max(lowestY, Math.min(highestY, targetY));
|
||||
}
|
||||
|
||||
public static int columnTargetY(int dx, int dz, int lowX, int highX, int lowZ, int highZ,
|
||||
double effectiveRadius, double falloff, int originalY, int meetY) {
|
||||
double factor = columnInfluence(
|
||||
|
||||
@@ -84,8 +84,8 @@ public final class VacuumModule implements IrisModule {
|
||||
private final double waveAmplitude;
|
||||
private final double waveScale;
|
||||
private final SimplexNoise waves;
|
||||
private final int worldMin;
|
||||
private final int worldMax;
|
||||
private final int lowestY;
|
||||
private final int highestY;
|
||||
|
||||
private Bend(PlacementStageContext context, PreparedPlacement prepared, Engine engine) {
|
||||
ObjectPlaceMode mode = prepared.mode();
|
||||
@@ -101,8 +101,8 @@ public final class VacuumModule implements IrisModule {
|
||||
this.waveAmplitude = IrisObjectVacuum.resolveWaveAmplitude(settings);
|
||||
this.waveScale = IrisObjectVacuum.resolveWaveScale(settings);
|
||||
this.waves = mode == ObjectPlaceMode.VACUUM_WAVY && waveAmplitude > 0 ? new SimplexNoise(WAVE_SEED) : null;
|
||||
this.worldMin = engine.getMinHeight();
|
||||
this.worldMax = worldMin + engine.getHeight() - 1;
|
||||
this.lowestY = IrisObjectVacuum.LOWEST_TARGET_Y;
|
||||
this.highestY = engine.getHeight() - 1;
|
||||
}
|
||||
|
||||
private void apply(int baseY, int topY) {
|
||||
@@ -124,7 +124,7 @@ public final class VacuumModule implements IrisModule {
|
||||
if (targetY == originalY) {
|
||||
return;
|
||||
}
|
||||
targetY = Math.max(worldMin + 1, Math.min(worldMax, targetY));
|
||||
targetY = IrisObjectVacuum.clampTargetY(targetY, lowestY, highestY);
|
||||
if (targetY > originalY) {
|
||||
raise(x, z, originalY, targetY);
|
||||
} else if (targetY < originalY) {
|
||||
|
||||
Reference in new issue
Block a user