mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 16:25:36 +00:00
Placement settings as module-owned IrisApi types: object limit, slope clip, stilt, vacuum, block replace, axis rotation clamp
This commit is contained in:
1 parent
c1f23830a2
commit
9401e8aa78
34 files changed
+654
-362
No files matched your search
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.builtin.blocks;
|
||||
|
||||
import com.volmit.block.BlockSpec;
|
||||
import com.volmit.block.PaletteSpec;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinItems;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Required;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/** One find-and-replace of an object placement's blocks, an entry of the placement's {@code edit}. */
|
||||
@Snippet("object-block-replacer")
|
||||
@Desc("Find and replace object materials")
|
||||
public final class ObjectReplace {
|
||||
@MinItems(1)
|
||||
@Required
|
||||
@Desc("Find this block")
|
||||
private List<BlockSpec> find = List.of();
|
||||
@Required
|
||||
@Desc("Replace it with this block palette")
|
||||
private PaletteSpec replace = PaletteSpec.of(List.of(BlockSpec.of("stone")));
|
||||
@Desc("Exactly match the block data or not")
|
||||
private boolean exact = false;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Modifies the chance the block is replaced")
|
||||
private float chance = 1;
|
||||
|
||||
public ObjectReplace() {
|
||||
}
|
||||
|
||||
public List<BlockSpec> find() {
|
||||
return find == null ? List.of() : Collections.unmodifiableList(find);
|
||||
}
|
||||
|
||||
public PaletteSpec replace() {
|
||||
return replace == null ? PaletteSpec.of(List.of(BlockSpec.of("stone"))) : replace;
|
||||
}
|
||||
|
||||
public boolean exact() {
|
||||
return exact;
|
||||
}
|
||||
|
||||
public float chance() {
|
||||
return chance;
|
||||
}
|
||||
}
|
||||
+65
-29
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,57 +16,78 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.prefab;
|
||||
package art.arcane.iris.builtin.prepare;
|
||||
|
||||
import art.arcane.iris.engine.object.annotations.DependsOn;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Required;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import art.arcane.volmlib.util.math.M;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Required;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/** One axis of an object rotation, with the angles it may turn by and the steps between them. */
|
||||
@Snippet("axis-rotation")
|
||||
@Accessors(chain = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Desc("Represents a rotation axis with intervals and maxes. The x and z axis values are defaulted to disabled. The Y axis defaults to on, rotating by 90 degree increments.")
|
||||
@Data
|
||||
public class IrisAxisRotationClamp {
|
||||
public final class AxisRotationClamp {
|
||||
private static final double FULL_TURN_DEGREES = 360D;
|
||||
|
||||
@Desc("Should this axis be rotated at all?")
|
||||
private boolean enabled = false;
|
||||
|
||||
private transient boolean forceLock = false;
|
||||
|
||||
@Required
|
||||
@DependsOn({"max"})
|
||||
@MinNumber(-360)
|
||||
@MaxNumber(360)
|
||||
@Desc("The minimum angle (from) or set this and max to zero for any angle degrees. Set both to the same non-zero value to force it to that angle only")
|
||||
private double min = 0;
|
||||
|
||||
@Required
|
||||
@DependsOn({"min"})
|
||||
@MinNumber(-360)
|
||||
@MaxNumber(360)
|
||||
@Desc("The maximum angle (to) or set this and min to zero for any angle degrees. Set both to the same non-zero value to force it to that angle only")
|
||||
private double max = 0;
|
||||
|
||||
@Required
|
||||
@DependsOn({"min", "max"})
|
||||
@MinNumber(0)
|
||||
@MaxNumber(360)
|
||||
@Desc("Iris spins the axis but not freely. For example an interval of 90 would mean 4 possible angles (right angles) degrees. \nSetting this to 0 means totally free rotation.\n\nNote that a lot of structures can have issues with non 90 degree intervals because the minecraft block resolution is so low.")
|
||||
private double interval = 0;
|
||||
|
||||
public void minMax(double fd) {
|
||||
min = fd;
|
||||
max = fd;
|
||||
forceLock = true;
|
||||
public AxisRotationClamp() {
|
||||
}
|
||||
|
||||
/** An axis turned as {@code enabled} says, by angles from {@code min} to {@code max} in steps of {@code interval}. */
|
||||
public static AxisRotationClamp of(boolean enabled, boolean forceLock, double min, double max, double interval) {
|
||||
AxisRotationClamp clamp = new AxisRotationClamp();
|
||||
clamp.enabled = enabled;
|
||||
clamp.forceLock = forceLock;
|
||||
clamp.min = min;
|
||||
clamp.max = max;
|
||||
clamp.interval = interval;
|
||||
return clamp;
|
||||
}
|
||||
|
||||
/** An axis that turns to exactly {@code angle}, in steps of {@code interval}, whatever its min and max say. */
|
||||
public static AxisRotationClamp locked(boolean enabled, double angle, double interval) {
|
||||
return of(enabled, true, angle, angle, interval);
|
||||
}
|
||||
|
||||
public boolean enabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public double min() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public double max() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public double interval() {
|
||||
return interval;
|
||||
}
|
||||
|
||||
public boolean isUnlimited() {
|
||||
@@ -79,18 +100,33 @@ public class IrisAxisRotationClamp {
|
||||
|
||||
public double getRadians(int rng) {
|
||||
if (forceLock) {
|
||||
return Math.toRadians(Math.ceil(Math.abs((max % 360D))));
|
||||
return Math.toRadians(Math.ceil(Math.abs((max % FULL_TURN_DEGREES))));
|
||||
}
|
||||
|
||||
if (isUnlimited()) {
|
||||
double resolvedInterval = interval < 1 ? 1 : interval;
|
||||
return Math.toRadians((resolvedInterval * (Math.ceil(Math.abs((rng % 360D) / resolvedInterval)))) % 360D);
|
||||
return Math.toRadians((resolvedInterval * (Math.ceil(Math.abs((rng % FULL_TURN_DEGREES) / resolvedInterval)))) % FULL_TURN_DEGREES);
|
||||
}
|
||||
|
||||
if (min == max && min != 0) {
|
||||
return Math.toRadians(max);
|
||||
}
|
||||
|
||||
return Math.toRadians(M.clip((interval * (Math.ceil(Math.abs((rng % 360D) / interval)))) % 360D, Math.min(min, max), Math.max(min, max)));
|
||||
double angle = (interval * (Math.ceil(Math.abs((rng % FULL_TURN_DEGREES) / interval)))) % FULL_TURN_DEGREES;
|
||||
return Math.toRadians(Math.min(Math.max(min, max), Math.max(Math.min(min, max), angle)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return other instanceof AxisRotationClamp clamp
|
||||
&& enabled == clamp.enabled
|
||||
&& Double.compare(min, clamp.min) == 0
|
||||
&& Double.compare(max, clamp.max) == 0
|
||||
&& Double.compare(interval, clamp.interval) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enabled, min, max, interval);
|
||||
}
|
||||
}
|
||||
+27
-20
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,39 +16,46 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
package art.arcane.iris.builtin.prepare;
|
||||
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
/** The terrain slopes a placement or decorator may sit on, written as its {@code slopeCondition}. */
|
||||
@Snippet("slope-clip")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Limits placement to a minimum and maximum terrain slope")
|
||||
@Data
|
||||
public class IrisSlopeClip {
|
||||
public final class SlopeClip {
|
||||
private static final double DEFAULT_MINIMUM_SLOPE = 0;
|
||||
private static final double DEFAULT_MAXIMUM_SLOPE = 10;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1024)
|
||||
@Desc("The minimum slope for placement")
|
||||
private double minimumSlope = 0;
|
||||
private double minimumSlope = DEFAULT_MINIMUM_SLOPE;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1024)
|
||||
@Desc("The maximum slope for placement")
|
||||
private double maximumSlope = 10;
|
||||
private double maximumSlope = DEFAULT_MAXIMUM_SLOPE;
|
||||
|
||||
public SlopeClip() {
|
||||
}
|
||||
|
||||
public double minimumSlope() {
|
||||
return minimumSlope;
|
||||
}
|
||||
|
||||
public double maximumSlope() {
|
||||
return maximumSlope;
|
||||
}
|
||||
|
||||
/** Whether every slope passes. */
|
||||
public boolean isDefault() {
|
||||
return minimumSlope <= 0 && maximumSlope >= 10;
|
||||
return minimumSlope <= 0 && maximumSlope >= DEFAULT_MAXIMUM_SLOPE;
|
||||
}
|
||||
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean isValid(double slope) {
|
||||
if (isDefault()) {
|
||||
return true;
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.builtin.stilt;
|
||||
|
||||
import com.volmit.block.PaletteSpec;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/** How far and with which blocks an object stilts into the ground, written as the placement's {@code stiltSettings}. */
|
||||
@Snippet("stilt-settings")
|
||||
@Desc("Defines stilting behaviour.")
|
||||
public final class StiltSettings {
|
||||
@MinNumber(0)
|
||||
@MaxNumber(64)
|
||||
@Desc("Defines the maximum amount of blocks the object stilts verticially before overstilting and randomRange.")
|
||||
private int yMax;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(64)
|
||||
@Desc("Defines the upper boundary for additional blocks after overstilting and/or maxStiltRange.")
|
||||
private int yRand;
|
||||
@MaxNumber(64)
|
||||
@MinNumber(0)
|
||||
@Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.")
|
||||
private int overStilt;
|
||||
@Desc("If defined, stilting will be done using this block palette rather than the last layer of the object.")
|
||||
private PaletteSpec palette;
|
||||
@MinNumber(1)
|
||||
@MaxNumber(256)
|
||||
@Desc("For ORGANIC_STILT / CEILING_HANG: the maximum number of blocks to scan toward the cave floor (or ceiling) looking for solid ground before giving up.")
|
||||
private int organicMaxScan = 48;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(32)
|
||||
@Desc("For ORGANIC_STILT / CEILING_HANG: the maximum number of blocks each column's stilt is randomly shortened by, giving the underside a ragged organic edge instead of a flat disc.")
|
||||
private int organicJitter = 3;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("For ORGANIC_STILT / CEILING_HANG: in the deepest fraction of each stilt column, blocks are randomly skipped to break the tip up. Higher = more broken and scratchy. 0 disables.")
|
||||
private double organicScratch = 0.55;
|
||||
|
||||
public StiltSettings() {
|
||||
}
|
||||
|
||||
public int yMax() {
|
||||
return yMax;
|
||||
}
|
||||
|
||||
public int yRand() {
|
||||
return yRand;
|
||||
}
|
||||
|
||||
public int overStilt() {
|
||||
return overStilt;
|
||||
}
|
||||
|
||||
public Optional<PaletteSpec> palette() {
|
||||
return Optional.ofNullable(palette);
|
||||
}
|
||||
|
||||
public int organicMaxScan() {
|
||||
return organicMaxScan;
|
||||
}
|
||||
|
||||
public int organicJitter() {
|
||||
return organicJitter;
|
||||
}
|
||||
|
||||
public double organicScratch() {
|
||||
return organicScratch;
|
||||
}
|
||||
}
|
||||
+48
-14
@@ -1,21 +1,32 @@
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
package art.arcane.iris.builtin.vacuum;
|
||||
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
/** How a VACUUM place mode bends terrain to meet an object's base, written as the placement's {@code vacuumSettings}. */
|
||||
@Snippet("vacuum-settings")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Defines how a VACUUM place mode bends terrain to meet an object's base.")
|
||||
@Data
|
||||
public class IrisVacuumSettings {
|
||||
public final class VacuumSettings {
|
||||
@MinNumber(0)
|
||||
@MaxNumber(128)
|
||||
@Desc("The horizontal radius (in blocks) the terrain deformation extends beyond the object footprint before it blends back to the natural surface. 0 = derive automatically from the place mode (VACUUM, VACUUM_HIGH larger, VACUUM_FAST smaller).")
|
||||
@@ -36,4 +47,27 @@ public class IrisVacuumSettings {
|
||||
@MaxNumber(64)
|
||||
@Desc("For VACUUM_WAVY: the frequency of the simplex wave. Higher values make tighter, choppier ripples; lower values make broad, gentle swells. The wavelength in blocks is roughly 100 / waveScale.")
|
||||
private double waveScale = 5.0;
|
||||
|
||||
public VacuumSettings() {
|
||||
}
|
||||
|
||||
public int radius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public double falloff() {
|
||||
return falloff;
|
||||
}
|
||||
|
||||
public int organicJitter() {
|
||||
return organicJitter;
|
||||
}
|
||||
|
||||
public int waveAmplitude() {
|
||||
return waveAmplitude;
|
||||
}
|
||||
|
||||
public double waveScale() {
|
||||
return waveScale;
|
||||
}
|
||||
}
|
||||
+23
-18
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,24 +16,17 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
package art.arcane.iris.builtin.validate;
|
||||
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
/** The heights an object placement may sit between, written as the placement's {@code clamp}. */
|
||||
@Snippet("object-limit")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Limits object placement by minimum and maximum world height")
|
||||
@Data
|
||||
public class IrisObjectLimit {
|
||||
public final class ObjectLimit {
|
||||
@MinNumber(-2048)
|
||||
@MaxNumber(2048)
|
||||
@Desc("The minimum height for placement (bottom of object)")
|
||||
@@ -44,7 +37,19 @@ public class IrisObjectLimit {
|
||||
@Desc("The maximum height for placement (top of object)")
|
||||
private int maximumHeight = 2048;
|
||||
|
||||
public boolean canPlace(int h, int l) {
|
||||
return h <= maximumHeight && l >= minimumHeight;
|
||||
public ObjectLimit() {
|
||||
}
|
||||
|
||||
public int minimumHeight() {
|
||||
return minimumHeight;
|
||||
}
|
||||
|
||||
public int maximumHeight() {
|
||||
return maximumHeight;
|
||||
}
|
||||
|
||||
/** Whether an object whose top is at {@code highest} and bottom at {@code lowest} fits between the limits. */
|
||||
public boolean canPlace(int highest, int lowest) {
|
||||
return highest <= maximumHeight && lowest >= minimumHeight;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
package art.arcane.iris.engine.mantle.components;
|
||||
|
||||
|
||||
import art.arcane.iris.builtin.prepare.AxisRotationClamp;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectVacuum;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
@@ -32,7 +33,6 @@ import art.arcane.iris.engine.framework.TreeBlockMaterial;
|
||||
import art.arcane.iris.engine.object.terrain.carving.CarvingMode;
|
||||
import art.arcane.iris.engine.object.placement.DecayControlPlacer;
|
||||
import art.arcane.iris.engine.object.placement.IObjectPlacer;
|
||||
import art.arcane.iris.engine.object.prefab.IrisAxisRotationClamp;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.terrain.carving.IrisCaveAnchorMode;
|
||||
import art.arcane.iris.engine.object.terrain.carving.IrisCaveProfile;
|
||||
@@ -1092,9 +1092,9 @@ public class ObjectPlacing {
|
||||
private IrisObjectRotation buildUpsideDownRotation() {
|
||||
IrisObjectRotation rt = new IrisObjectRotation();
|
||||
rt.setEnabled(true);
|
||||
rt.setXAxis(new IrisAxisRotationClamp(true, true, 180D, 180D, 90D));
|
||||
rt.setYAxis(new IrisAxisRotationClamp(true, false, 0D, 0D, 90D));
|
||||
rt.setZAxis(new IrisAxisRotationClamp());
|
||||
rt.setXAxis(AxisRotationClamp.of(true, true, 180D, 180D, 90D));
|
||||
rt.setYAxis(AxisRotationClamp.of(true, false, 0D, 0D, 90D));
|
||||
rt.setZAxis(new AxisRotationClamp());
|
||||
return rt;
|
||||
}
|
||||
|
||||
@@ -1542,8 +1542,8 @@ public class ObjectPlacing {
|
||||
int height = scaledDimension(size.getBlockY(), scale);
|
||||
int depth = scaledDimension(size.getBlockZ(), scale);
|
||||
IrisObjectRotation rotation = placement.getRotation();
|
||||
boolean rotateX = rotation != null && rotation.isEnabled() && rotation.getXAxis() != null && rotation.getXAxis().isEnabled();
|
||||
boolean rotateZ = rotation != null && rotation.isEnabled() && rotation.getZAxis() != null && rotation.getZAxis().isEnabled();
|
||||
boolean rotateX = rotation != null && rotation.isEnabled() && rotation.getXAxis() != null && rotation.getXAxis().enabled();
|
||||
boolean rotateZ = rotation != null && rotation.isEnabled() && rotation.getZAxis() != null && rotation.getZAxis().enabled();
|
||||
int footprint = rotateX || rotateZ ? Math.max(width, Math.max(height, depth)) : Math.max(width, depth);
|
||||
int translation = calculateTranslationReach(placement.getTranslate(), rotation, rotateX || rotateZ);
|
||||
int warp = placement.getWarp() != null && !placement.getWarp().isFlat()
|
||||
@@ -1574,7 +1574,7 @@ public class ObjectPlacing {
|
||||
if (rotateVertically) {
|
||||
return (int) Math.ceil(Math.sqrt((x * x) + (y * y) + (z * z)));
|
||||
}
|
||||
boolean rotateY = rotation != null && rotation.isEnabled() && rotation.getYAxis() != null && rotation.getYAxis().isEnabled();
|
||||
boolean rotateY = rotation != null && rotation.isEnabled() && rotation.getYAxis() != null && rotation.getYAxis().enabled();
|
||||
return rotateY ? (int) Math.ceil(Math.hypot(x, z)) : (int) Math.max(Math.abs(x), Math.abs(z));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import art.arcane.iris.engine.object.world.biome.custom.IrisBiomeCustom;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
@@ -34,7 +35,6 @@ import art.arcane.iris.engine.object.terrain.IrisBiomePaletteLayer;
|
||||
import art.arcane.iris.engine.object.decoration.IrisDecorationPart;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.terrain.floating.IrisFloatingChildBiomes;
|
||||
import art.arcane.iris.engine.object.placement.IrisSlopeClip;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
@@ -86,7 +86,7 @@ public class FloatingIslands {
|
||||
continue;
|
||||
}
|
||||
double layerDepth = heightGenerator.fit(layer.getMinHeight(), layer.getMaxHeight(), wx / layer.getZoom(), wz / layer.getZoom());
|
||||
IrisSlopeClip slopeClip = layer.getSlopeCondition();
|
||||
SlopeClip slopeClip = layer.getSlopeCondition();
|
||||
|
||||
if (slopeClip != null && !slopeClip.isDefault() && complex != null && !slopeClip.isValid(complex.getSlopeStream().get(wx, wz))) {
|
||||
layerDepth = 0;
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.mantle.EngineMantle;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.procedural.IrisProceduralBlocks;
|
||||
import art.arcane.iris.engine.object.placement.IrisSlopeClip;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -210,7 +210,7 @@ public class SurfaceSmoothing {
|
||||
|| (hd == h + 1 && isSolidNonSlab(x, hd, z - 1, originX, originZ, currentData)))
|
||||
//@done
|
||||
{
|
||||
IrisSlopeClip sc = biome.getSlab().getSlopeCondition();
|
||||
SlopeClip sc = biome.getSlab().getSlopeCondition();
|
||||
PlatformBlockState d = sc.isValid(engine.getComplex().getSlopeStream().get(x, z)) ? biome.getSlab().get(rng, x, h, z, engine.getData()) : null;
|
||||
|
||||
if (d != null) {
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object.decoration;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import art.arcane.iris.engine.object.noise.NoiseStyle;
|
||||
import art.arcane.iris.engine.object.placement.IrisSlopeClip;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
@@ -71,7 +71,7 @@ public class IrisDecorator {
|
||||
@Desc("When set, the decorator will never place onto any of these blocks.")
|
||||
private KList<IrisBlockData> blacklist;
|
||||
@Desc("The slope at which this decorator can be placed. Range from 0 to 10 by default. Calculated from a 3-block radius from the center of the decorator placement.")
|
||||
private IrisSlopeClip slopeCondition = new IrisSlopeClip();
|
||||
private SlopeClip slopeCondition = new SlopeClip();
|
||||
@DependsOn({"scaleStack", "stackMin", "stackMax"})
|
||||
@Desc("If stackMax is set to true, use this to limit its max height for large caverns")
|
||||
private int absoluteMaxStack = 30;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.object.mod;
|
||||
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectReplace;
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.region.IrisRegion;
|
||||
@@ -100,9 +100,9 @@ public class IrisMod extends IrisRegistrant {
|
||||
@Desc("Replace regions with other regions")
|
||||
private KList<IrisModRegionReplacer> regionReplacers = new KList<>();
|
||||
|
||||
@ArrayType(min = 1, type = IrisObjectReplace.class)
|
||||
@ArrayType(min = 1, type = ObjectReplace.class)
|
||||
@Desc("Replace blocks with other blocks")
|
||||
private KList<IrisObjectReplace> blockReplacers = new KList<>();
|
||||
private KList<ObjectReplace> blockReplacers = new KList<>();
|
||||
|
||||
@ArrayType(min = 1, type = IrisModNoiseStyleReplacer.class)
|
||||
@Desc("Replace noise styles with other styles")
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import com.volmit.FeatureRegistry;
|
||||
import art.arcane.iris.builtin.IrisStages;
|
||||
import art.arcane.iris.builtin.blocks.ObjectMarkers;
|
||||
import art.arcane.iris.builtin.blocks.WrittenBlocks;
|
||||
@@ -65,6 +67,11 @@ public final class BlocksModule implements IrisModule {
|
||||
return ModuleInfo.of("iris:blocks", "Object blocks", PlacementModules.VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(FeatureRegistry registry) {
|
||||
registry.registerHeldType(ObjectReplace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(IrisStages.Blocks.WRITE)
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
import art.arcane.iris.engine.object.loot.IObjectLoot;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
@@ -96,7 +101,7 @@ public class IrisObjectPlacement {
|
||||
@Desc("Rotate this objects placement")
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
@Desc("Limit the max height or min height of placement.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("The maximum layer level of a snow filter overtop of this placement. Set to 0 to disable. Max of 1.")
|
||||
@@ -104,7 +109,7 @@ public class IrisObjectPlacement {
|
||||
@Desc("Whether or not this object can be targeted by a dolphin.")
|
||||
private boolean isDolphinTarget = false;
|
||||
@Desc("The slope at which this object can be placed. Range from 0 to 10 by default. Calculated from a 3-block radius from the center of the object placement.")
|
||||
private IrisSlopeClip slopeCondition = new IrisSlopeClip();
|
||||
private SlopeClip slopeCondition = new SlopeClip();
|
||||
@Desc("Set to true to add the rotation of the direction of the slope of the terrain (wherever the slope is going down) to the y-axis rotation of the object." +
|
||||
"Rounded to 90 degrees. Adds the *min* rotation of the y axis as well (to still allow you to rotate objects nicely). Discards *max* and *interval* on *yaxis*")
|
||||
private boolean rotateTowardsSlope = false;
|
||||
@@ -118,9 +123,9 @@ public class IrisObjectPlacement {
|
||||
@Desc("If the chance check passes, and you specify this, it picks a number in the range based on noise, and 'density' is ignored.")
|
||||
private IrisStyledRange densityStyle = null;
|
||||
@Desc("When stilting is enabled, this object will define various properties related to it.")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
@Desc("When a VACUUM place mode is used, this defines the deformation radius and falloff.")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
@MaxNumber(64)
|
||||
@MinNumber(0)
|
||||
@Desc("When bore is enabled, expand max-y of the cuboid it removes")
|
||||
@@ -168,9 +173,9 @@ public class IrisObjectPlacement {
|
||||
private IrisGeneratorStyle warp = new IrisGeneratorStyle(NoiseStyle.FLAT);
|
||||
@Desc("The placement mode")
|
||||
private ObjectPlaceMode mode = ObjectPlaceMode.CENTER_HEIGHT;
|
||||
@ArrayType(min = 1, type = IrisObjectReplace.class)
|
||||
@ArrayType(min = 1, type = ObjectReplace.class)
|
||||
@Desc("Find and replace blocks")
|
||||
private KList<IrisObjectReplace> edit = new KList<>();
|
||||
private KList<ObjectReplace> edit = new KList<>();
|
||||
@Desc("Translate this object's placement")
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
@Desc("Scale Objects")
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.ArrayType;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Required;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Snippet("object-block-replacer")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Find and replace object materials")
|
||||
@Data
|
||||
public class IrisObjectReplace {
|
||||
private final transient AtomicCache<CNG> replaceGen = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<PlatformBlockState>> findData = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<PlatformBlockState>> replaceData = new AtomicCache<>();
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Required
|
||||
@Desc("Find this block")
|
||||
private KList<IrisBlockData> find = new KList<>();
|
||||
@Required
|
||||
@Desc("Replace it with this block palette")
|
||||
private IrisMaterialPalette replace = new IrisMaterialPalette();
|
||||
@Desc("Exactly match the block data or not")
|
||||
private boolean exact = false;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Modifies the chance the block is replaced")
|
||||
private float chance = 1;
|
||||
|
||||
public KList<PlatformBlockState> getFind(IrisData rdata) {
|
||||
return findData.aquire(() ->
|
||||
{
|
||||
KList<PlatformBlockState> b = new KList<>();
|
||||
|
||||
for (IrisBlockData i : find) {
|
||||
PlatformBlockState bx = i.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
b.add(bx);
|
||||
}
|
||||
}
|
||||
|
||||
return b;
|
||||
});
|
||||
}
|
||||
|
||||
public PlatformBlockState getReplace(RNG seed, double x, double y, double z, IrisData rdata) {
|
||||
return getReplace().get(seed, x, y, z, rdata);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
|
||||
public final class IrisObjectVacuum {
|
||||
private static final double DEFAULT_WAVE_AMPLITUDE = 3.0;
|
||||
private static final double DEFAULT_WAVE_SCALE = 5.0;
|
||||
@@ -35,14 +37,14 @@ public final class IrisObjectVacuum {
|
||||
|| mode == ObjectPlaceMode.VACUUM_WAVY;
|
||||
}
|
||||
|
||||
public static int resolveRadius(ObjectPlaceMode mode, IrisVacuumSettings settings) {
|
||||
public static int resolveRadius(ObjectPlaceMode mode, VacuumSettings settings) {
|
||||
int radius = switch (mode) {
|
||||
case VACUUM_HIGH -> 20;
|
||||
case VACUUM_FAST -> 8;
|
||||
default -> 12;
|
||||
};
|
||||
if (settings != null && settings.getRadius() > 0) {
|
||||
radius = settings.getRadius();
|
||||
if (settings != null && settings.radius() > 0) {
|
||||
radius = settings.radius();
|
||||
}
|
||||
return Math.max(0, Math.min(MAX_RADIUS_BLOCKS, radius));
|
||||
}
|
||||
@@ -51,22 +53,22 @@ public final class IrisObjectVacuum {
|
||||
return mode == ObjectPlaceMode.VACUUM_FAST ? 2 : 1;
|
||||
}
|
||||
|
||||
public static double resolveFalloff(IrisVacuumSettings settings) {
|
||||
return settings != null ? Math.max(0.25, settings.getFalloff()) : 2.0;
|
||||
public static double resolveFalloff(VacuumSettings settings) {
|
||||
return settings != null ? Math.max(0.25, settings.falloff()) : 2.0;
|
||||
}
|
||||
|
||||
public static double resolveWaveAmplitude(IrisVacuumSettings settings) {
|
||||
public static double resolveWaveAmplitude(VacuumSettings settings) {
|
||||
if (settings == null) {
|
||||
return DEFAULT_WAVE_AMPLITUDE;
|
||||
}
|
||||
return Math.max(0, settings.getWaveAmplitude());
|
||||
return Math.max(0, settings.waveAmplitude());
|
||||
}
|
||||
|
||||
public static double resolveWaveScale(IrisVacuumSettings settings) {
|
||||
public static double resolveWaveScale(VacuumSettings settings) {
|
||||
if (settings == null) {
|
||||
return DEFAULT_WAVE_SCALE;
|
||||
}
|
||||
double scale = settings.getWaveScale();
|
||||
double scale = settings.waveScale();
|
||||
return scale > 0 ? scale : DEFAULT_WAVE_SCALE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Snippet("stilt-settings")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Defines stilting behaviour.")
|
||||
@Data
|
||||
public class IrisStiltSettings {
|
||||
@MinNumber(0)
|
||||
@MaxNumber(64)
|
||||
@Desc("Defines the maximum amount of blocks the object stilts verticially before overstilting and randomRange.")
|
||||
private int yMax;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(64)
|
||||
@Desc("Defines the upper boundary for additional blocks after overstilting and/or maxStiltRange.")
|
||||
private int yRand;
|
||||
@MaxNumber(64)
|
||||
@MinNumber(0)
|
||||
@Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.")
|
||||
private int overStilt;
|
||||
@Desc("If defined, stilting will be done using this block palette rather than the last layer of the object.")
|
||||
private IrisMaterialPalette palette;
|
||||
@MinNumber(1)
|
||||
@MaxNumber(256)
|
||||
@Desc("For ORGANIC_STILT / CEILING_HANG: the maximum number of blocks to scan toward the cave floor (or ceiling) looking for solid ground before giving up.")
|
||||
private int organicMaxScan = 48;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(32)
|
||||
@Desc("For ORGANIC_STILT / CEILING_HANG: the maximum number of blocks each column's stilt is randomly shortened by, giving the underside a ragged organic edge instead of a flat disc.")
|
||||
private int organicJitter = 3;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("For ORGANIC_STILT / CEILING_HANG: in the deepest fraction of each stilt column, blocks are randomly skipped to break the tip up. Higher = more broken and scratchy. 0 disables.")
|
||||
private double organicScratch = 0.55;
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.object.material.BlockDataMergeSupport;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectShaping;
|
||||
@@ -37,25 +38,27 @@ final class ObjectEdits {
|
||||
/** {@code tile} may be null; the result's tile is the last replacement's tile, if it has one. */
|
||||
static Edited apply(IrisObjectPlacement config, PlatformBlockState data, TileData tile, RNG rng,
|
||||
double x, double y, double z, IrisData rdata) {
|
||||
ResolvedReplaces replaces = ResolvedReplaces.of(rdata);
|
||||
PlatformBlockState edited = data;
|
||||
TileData editedTile = tile;
|
||||
for (IrisObjectReplace replace : config.getEdit()) {
|
||||
if (!rng.chance(replace.getChance())) {
|
||||
for (ObjectReplace settings : config.getEdit()) {
|
||||
ResolvedReplace replace = replaces.of(settings);
|
||||
if (!rng.chance(replace.chance())) {
|
||||
continue;
|
||||
}
|
||||
for (PlatformBlockState find : replace.getFind(rdata)) {
|
||||
for (PlatformBlockState find : replace.find()) {
|
||||
if (!finds(replace, find, edited)) {
|
||||
continue;
|
||||
}
|
||||
edited = replaced(edited, replace.getReplace(rng, x, y, z, rdata));
|
||||
editedTile = replace.getReplace().getTile(rng, x, y, z, rdata).orElse(editedTile);
|
||||
edited = replaced(edited, replace.replacement(rng, x, y, z));
|
||||
editedTile = replace.tile(rng).orElse(editedTile);
|
||||
}
|
||||
}
|
||||
return new Edited(edited, editedTile);
|
||||
}
|
||||
|
||||
private static boolean finds(IrisObjectReplace replace, PlatformBlockState find, PlatformBlockState data) {
|
||||
return replace.isExact()
|
||||
private static boolean finds(ResolvedReplace replace, PlatformBlockState find, PlatformBlockState data) {
|
||||
return replace.exact()
|
||||
? find.matches(data)
|
||||
: IrisObjectShaping.materialKey(find).equals(IrisObjectShaping.materialKey(data));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.engine.object.prefab.IrisAxisRotationClamp;
|
||||
import art.arcane.iris.builtin.prepare.AxisRotationClamp;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.math.IrisBlockVector;
|
||||
@@ -55,20 +55,20 @@ import art.arcane.iris.util.common.math.IrisBlockVector;
|
||||
ySin = Math.sin(yAngle);
|
||||
}
|
||||
|
||||
private static int modeOf(IrisAxisRotationClamp clamp) {
|
||||
private static int modeOf(AxisRotationClamp clamp) {
|
||||
if (!clamp.isLocked()) {
|
||||
return MODE_ANGLE;
|
||||
}
|
||||
|
||||
if (Math.abs(clamp.getMax()) % 360D == 180D) {
|
||||
if (Math.abs(clamp.max()) % 360D == 180D) {
|
||||
return MODE_FLIP;
|
||||
}
|
||||
|
||||
if (clamp.getMax() % 360D == 90D || clamp.getMax() % 360D == -270D) {
|
||||
if (clamp.max() % 360D == 90D || clamp.max() % 360D == -270D) {
|
||||
return MODE_QUARTER;
|
||||
}
|
||||
|
||||
if (clamp.getMax() == -90D || clamp.getMax() % 360D == 270D) {
|
||||
if (clamp.max() == -90D || clamp.max() % 360D == 270D) {
|
||||
return MODE_THREE_QUARTER;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,13 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import com.volmit.FeatureRegistry;
|
||||
import art.arcane.iris.builtin.prepare.AxisRotationClamp;
|
||||
import art.arcane.iris.builtin.IrisStages;
|
||||
import art.arcane.iris.core.modules.IrisPlacement;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.placer.HeightmapObjectPlacer;
|
||||
import art.arcane.iris.engine.object.prefab.IrisAxisRotationClamp;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectTranslate;
|
||||
@@ -52,6 +54,12 @@ public final class PrepareModule implements IrisModule {
|
||||
return ModuleInfo.of("iris:prepare", "Placement preparation", PlacementModules.VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(FeatureRegistry registry) {
|
||||
registry.registerHeldType(SlopeClip.class);
|
||||
registry.registerHeldType(AxisRotationClamp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(IrisStages.Prepare.SLOPE).produce(PrepareModule::slope);
|
||||
@@ -89,15 +97,15 @@ public final class PrepareModule implements IrisModule {
|
||||
double downhill = lowest == north ? NORTH : lowest == east ? EAST : lowest == south ? SOUTH : WEST;
|
||||
|
||||
IrisObjectRotation requested = config.getRotation();
|
||||
double turn = requested.getYAxis().getMin() + downhill;
|
||||
double turn = requested.getYAxis().min() + downhill;
|
||||
IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
rotation.setXAxis(requested.getXAxis());
|
||||
rotation.setZAxis(requested.getZAxis());
|
||||
if (turn == 0) {
|
||||
rotation.setYAxis(new IrisAxisRotationClamp(false, false, 0, 0, QUARTER_TURN));
|
||||
rotation.setYAxis(AxisRotationClamp.of(false, false, 0, 0, QUARTER_TURN));
|
||||
rotation.setEnabled(requested.canRotateX() || requested.canRotateZ());
|
||||
} else {
|
||||
rotation.setYAxis(new IrisAxisRotationClamp(true, false, turn, turn, QUARTER_TURN));
|
||||
rotation.setYAxis(AxisRotationClamp.of(true, false, turn, turn, QUARTER_TURN));
|
||||
rotation.setEnabled(true);
|
||||
}
|
||||
IrisObjectPlacement turned = config.toPlacement(config.getPlace().toArray(new String[0]));
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.core.modules.BlockEntities;
|
||||
import art.arcane.iris.engine.object.prefab.TileData;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.block.BlockRegistry;
|
||||
import com.volmit.block.BlockSpec;
|
||||
import com.volmit.block.PaletteSpec;
|
||||
import com.volmit.object.BlockEntityData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* One {@link ObjectReplace} made ready for a pack: the blocks it finds resolved to the platform's, its palette
|
||||
* picked through the pack's block registry with the seed of the {@link RNG} the placement hands in, and the tile
|
||||
* data of the palette's entries resolved once. The old settings class cached the same things on itself.
|
||||
*/
|
||||
final class ResolvedReplace {
|
||||
private final List<PlatformBlockState> find;
|
||||
private final boolean exact;
|
||||
private final float chance;
|
||||
private final PaletteSpec replace;
|
||||
private final BlockRegistry blocks;
|
||||
private final List<Optional<BlockEntityData>> entryTiles;
|
||||
private final int weightedSize;
|
||||
|
||||
ResolvedReplace(List<PlatformBlockState> find, boolean exact, float chance, PaletteSpec replace, BlockRegistry blocks) {
|
||||
this.find = List.copyOf(find);
|
||||
this.exact = exact;
|
||||
this.chance = chance;
|
||||
this.replace = replace;
|
||||
this.blocks = blocks;
|
||||
this.entryTiles = replace.palette().stream().map(blocks::blockEntity).toList();
|
||||
this.weightedSize = replace.palette().stream().mapToInt(spec -> Math.max(0, spec.weight())).sum();
|
||||
}
|
||||
|
||||
static ResolvedReplace of(ObjectReplace settings, BlockRegistry blocks) {
|
||||
List<PlatformBlockState> find = settings.find().stream()
|
||||
.map(spec -> B.getState(blocks.resolve(spec).key()))
|
||||
.toList();
|
||||
return new ResolvedReplace(find, settings.exact(), settings.chance(), settings.replace(), blocks);
|
||||
}
|
||||
|
||||
float chance() {
|
||||
return chance;
|
||||
}
|
||||
|
||||
boolean exact() {
|
||||
return exact;
|
||||
}
|
||||
|
||||
List<PlatformBlockState> find() {
|
||||
return find;
|
||||
}
|
||||
|
||||
PlatformBlockState replacement(RNG rng, double x, double y, double z) {
|
||||
return B.getState(blocks.palette(replace, rng.getSeed()).at(x, y, z).key());
|
||||
}
|
||||
|
||||
/** The tile data of the entry picked for {@code rng}: the first entry when the palette's weights add up to one, else a uniform pick. */
|
||||
Optional<TileData> tile(RNG rng) {
|
||||
if (weightedSize == 0) {
|
||||
return Optional.empty();
|
||||
}
|
||||
Optional<BlockEntityData> entity = entryTiles.get(weightedSize == 1 ? 0 : pickedEntry(rng));
|
||||
return entity.map(BlockEntities::tileOf);
|
||||
}
|
||||
|
||||
private int pickedEntry(RNG rng) {
|
||||
return entryTiles.size() == 1 ? 0 : rng.nextInt(entryTiles.size());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import com.volmit.block.BlockRegistry;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/** The {@link ResolvedReplace}s of one engine runtime, one per decoded {@link ObjectReplace}, built when a placement first uses it. */
|
||||
final class ResolvedReplaces {
|
||||
private final BlockRegistry blocks;
|
||||
private final Map<ObjectReplace, ResolvedReplace> resolved = new ConcurrentHashMap<>();
|
||||
|
||||
ResolvedReplaces(Engine engine) {
|
||||
this(engine.getData().getPackResources().blocks());
|
||||
}
|
||||
|
||||
ResolvedReplaces(BlockRegistry blocks) {
|
||||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
/** The replacements of the engine {@code data} serves, or of {@code data} alone when no engine runs it. */
|
||||
static ResolvedReplaces of(IrisData data) {
|
||||
Engine engine = data.getEngine();
|
||||
if (engine == null) {
|
||||
return new ResolvedReplaces(data.getPackResources().blocks());
|
||||
}
|
||||
return engine.getGeneration().state(ResolvedReplaces.class, ResolvedReplaces::new);
|
||||
}
|
||||
|
||||
ResolvedReplace of(ObjectReplace settings) {
|
||||
return resolved.computeIfAbsent(settings, replace -> ResolvedReplace.of(replace, blocks));
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import com.volmit.FeatureRegistry;
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.IrisStages;
|
||||
import art.arcane.iris.builtin.stilt.StiltLayers;
|
||||
import art.arcane.iris.core.modules.IrisPlacement;
|
||||
@@ -64,6 +66,11 @@ public final class StiltModule implements IrisModule {
|
||||
return ModuleInfo.of("iris:stilt", "Stilts", PlacementModules.VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(FeatureRegistry registry) {
|
||||
registry.registerHeldType(StiltSettings.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(IrisStages.Stilt.LAYERS)
|
||||
@@ -107,7 +114,8 @@ public final class StiltModule implements IrisModule {
|
||||
private final IrisPlacement placement;
|
||||
private final PreparedPlacement prepared;
|
||||
private final IrisObjectPlacement config;
|
||||
private final IrisStiltSettings settings;
|
||||
private final StiltSettings settings;
|
||||
private final PlatformBlockState palette;
|
||||
private final StiltShape shape;
|
||||
private final PlacementWorld world;
|
||||
private final RNG rng;
|
||||
@@ -124,10 +132,19 @@ public final class StiltModule implements IrisModule {
|
||||
this.world = new PlacementWorld(context.access(), placement.states());
|
||||
this.rng = new RNG(context.random().nextLong());
|
||||
this.anchorY = context.output(IrisStages.Anchor.FINAL).y();
|
||||
this.palette = settings == null ? null : paletteBlock(settings);
|
||||
this.layerY = shape == StiltShape.CEILING ? layers.topY() : layers.bottomY();
|
||||
this.erode = shape == StiltShape.ERODE ? ErodeShape.of(layers.bottom()) : null;
|
||||
}
|
||||
|
||||
/** The block the settings' palette picks for this placement, the same for every column; null without a palette. */
|
||||
private PlatformBlockState paletteBlock(StiltSettings stilt) {
|
||||
return stilt.palette()
|
||||
.map(spec -> placement.data().getPackResources().blocks().palette(spec, rng.getSeed()))
|
||||
.map(picker -> B.getState(picker.at(placement.x(), anchorY, placement.z()).key()))
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
private void grow(ObjectBlock block) {
|
||||
BlockPosition offset = block.position();
|
||||
PlatformBlockState state = stiltState(block, offset);
|
||||
@@ -152,8 +169,8 @@ public final class StiltModule implements IrisModule {
|
||||
/** The block the stilt repeats: the palette's when the settings have one, soil turned to dirt, edited and turned with the object. */
|
||||
private PlatformBlockState stiltState(ObjectBlock block, BlockPosition offset) {
|
||||
PlatformBlockState state = placement.states().toPlatform(block.state());
|
||||
if (settings != null && settings.getPalette() != null) {
|
||||
state = settings.getPalette().get(rng, placement.x(), anchorY, placement.z(), placement.data());
|
||||
if (palette != null) {
|
||||
state = palette;
|
||||
} else if (SOIL_MATERIALS.contains(IrisObjectShaping.materialKey(state))) {
|
||||
state = B.getState(SOIL_REPLACEMENT);
|
||||
}
|
||||
@@ -174,9 +191,9 @@ public final class StiltModule implements IrisModule {
|
||||
}
|
||||
int lowerBound = highest - 1;
|
||||
if (settings != null) {
|
||||
lowerBound -= settings.getOverStilt() - rng.i(0, settings.getYRand());
|
||||
if (settings.getYMax() != 0) {
|
||||
lowerBound -= Math.min(settings.getYMax() - (top - highest), 0);
|
||||
lowerBound -= settings.overStilt() - rng.i(0, settings.yRand());
|
||||
if (settings.yMax() != 0) {
|
||||
lowerBound -= Math.min(settings.yMax() - (top - highest), 0);
|
||||
}
|
||||
}
|
||||
if (erode != null) {
|
||||
@@ -198,9 +215,9 @@ public final class StiltModule implements IrisModule {
|
||||
|
||||
/** Grows from the layer toward the first solid block in {@code direction}, -1 down or 1 up. */
|
||||
private void growOrganic(PlatformBlockState state, int x, int z, int direction) {
|
||||
int maxScan = settings != null ? Math.max(1, settings.getOrganicMaxScan()) : DEFAULT_ORGANIC_MAX_SCAN;
|
||||
int jitterMax = settings != null ? Math.max(0, settings.getOrganicJitter()) : DEFAULT_ORGANIC_JITTER;
|
||||
double scratch = settings != null ? Math.max(0, Math.min(1, settings.getOrganicScratch())) : DEFAULT_ORGANIC_SCRATCH;
|
||||
int maxScan = settings != null ? Math.max(1, settings.organicMaxScan()) : DEFAULT_ORGANIC_MAX_SCAN;
|
||||
int jitterMax = settings != null ? Math.max(0, settings.organicJitter()) : DEFAULT_ORGANIC_JITTER;
|
||||
double scratch = settings != null ? Math.max(0, Math.min(1, settings.organicScratch())) : DEFAULT_ORGANIC_SCRATCH;
|
||||
long columnHash = ((long) x * HASH_X) ^ ((long) z * HASH_Y);
|
||||
int jitter = jitterMax > 0 ? (int) (Math.abs(columnHash) % (jitterMax + 1)) : 0;
|
||||
int start = layerY + anchorY;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import com.volmit.FeatureRegistry;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.IrisStages;
|
||||
import art.arcane.iris.builtin.blocks.WrittenBlocks;
|
||||
import art.arcane.iris.core.modules.IrisPlacement;
|
||||
@@ -49,6 +51,11 @@ public final class VacuumModule implements IrisModule {
|
||||
return ModuleInfo.of("iris:vacuum", "Vacuum", PlacementModules.VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(FeatureRegistry registry) {
|
||||
registry.registerHeldType(VacuumSettings.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(IrisStages.Vacuum.TERRAIN)
|
||||
@@ -91,11 +98,11 @@ public final class VacuumModule implements IrisModule {
|
||||
this.prepared = prepared;
|
||||
this.world = new PlacementWorld(context.access(), placement.states());
|
||||
this.complex = engine.getComplex();
|
||||
IrisVacuumSettings settings = prepared.config().getVacuumSettings();
|
||||
VacuumSettings settings = prepared.config().getVacuumSettings();
|
||||
this.radius = IrisObjectVacuum.resolveRadius(mode, settings);
|
||||
this.step = IrisObjectVacuum.resolveStep(mode);
|
||||
this.falloff = IrisObjectVacuum.resolveFalloff(settings);
|
||||
this.jitter = settings != null ? Math.max(0, settings.getOrganicJitter()) : DEFAULT_ORGANIC_JITTER;
|
||||
this.jitter = settings != null ? Math.max(0, settings.organicJitter()) : DEFAULT_ORGANIC_JITTER;
|
||||
this.waveAmplitude = IrisObjectVacuum.resolveWaveAmplitude(settings);
|
||||
this.waveScale = IrisObjectVacuum.resolveWaveScale(settings);
|
||||
this.waves = mode == ObjectPlaceMode.VACUUM_WAVY && waveAmplitude > 0 ? new SimplexNoise(WAVE_SEED) : null;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import com.volmit.FeatureRegistry;
|
||||
import art.arcane.iris.builtin.IrisStages;
|
||||
import art.arcane.iris.core.modules.IrisPlacement;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
@@ -53,6 +55,11 @@ public final class ValidateModule implements IrisModule {
|
||||
return ModuleInfo.of("iris:validate", "Placement checks", PlacementModules.VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(FeatureRegistry registry) {
|
||||
registry.registerHeldType(ObjectLimit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(IrisStages.Validate.SURFACE)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.object.prefab;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.AxisRotationClamp;
|
||||
import art.arcane.iris.engine.object.value.IrisDirection;
|
||||
import art.arcane.iris.engine.object.value.IrisPosition;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
@@ -79,64 +80,41 @@ public class IrisObjectRotation {
|
||||
private boolean enabled = true;
|
||||
|
||||
@Desc("The x axis rotation")
|
||||
private IrisAxisRotationClamp xAxis = new IrisAxisRotationClamp();
|
||||
private AxisRotationClamp xAxis = new AxisRotationClamp();
|
||||
|
||||
@Desc("The y axis rotation")
|
||||
private IrisAxisRotationClamp yAxis = new IrisAxisRotationClamp(true, false, 0, 0, 90);
|
||||
private AxisRotationClamp yAxis = AxisRotationClamp.of(true, false, 0, 0, 90);
|
||||
|
||||
@Desc("The z axis rotation")
|
||||
private IrisAxisRotationClamp zAxis = new IrisAxisRotationClamp();
|
||||
private AxisRotationClamp zAxis = new AxisRotationClamp();
|
||||
|
||||
public static IrisObjectRotation xFlip180() {
|
||||
IrisObjectRotation rt = new IrisObjectRotation();
|
||||
IrisAxisRotationClamp rtx = new IrisAxisRotationClamp();
|
||||
IrisAxisRotationClamp rty = new IrisAxisRotationClamp();
|
||||
IrisAxisRotationClamp rtz = new IrisAxisRotationClamp();
|
||||
rt.setEnabled(true);
|
||||
rt.setXAxis(rtx);
|
||||
rt.setYAxis(rty);
|
||||
rt.setZAxis(rtz);
|
||||
rtx.setEnabled(true);
|
||||
rtx.minMax(180);
|
||||
rty.setEnabled(false);
|
||||
rtz.setEnabled(false);
|
||||
rt.setXAxis(AxisRotationClamp.locked(true, 180, 0));
|
||||
rt.setYAxis(new AxisRotationClamp());
|
||||
rt.setZAxis(new AxisRotationClamp());
|
||||
return rt;
|
||||
}
|
||||
|
||||
public static IrisObjectRotation xFlip180RandomY() {
|
||||
IrisObjectRotation rt = xFlip180();
|
||||
rt.setYAxis(new IrisAxisRotationClamp(true, false, 0, 0, 90));
|
||||
rt.setYAxis(AxisRotationClamp.of(true, false, 0, 0, 90));
|
||||
return rt;
|
||||
}
|
||||
|
||||
public static IrisObjectRotation xFlip180WithY(double y) {
|
||||
IrisObjectRotation rt = xFlip180();
|
||||
IrisAxisRotationClamp rty = new IrisAxisRotationClamp();
|
||||
rty.setEnabled(true);
|
||||
rty.setInterval(90);
|
||||
rty.minMax(y);
|
||||
rt.setYAxis(rty);
|
||||
rt.setYAxis(AxisRotationClamp.locked(true, y, 90));
|
||||
return rt;
|
||||
}
|
||||
|
||||
public static IrisObjectRotation of(double x, double y, double z) {
|
||||
IrisObjectRotation rt = new IrisObjectRotation();
|
||||
IrisAxisRotationClamp rtx = new IrisAxisRotationClamp();
|
||||
IrisAxisRotationClamp rty = new IrisAxisRotationClamp();
|
||||
IrisAxisRotationClamp rtz = new IrisAxisRotationClamp();
|
||||
rt.setEnabled(x != 0 || y != 0 || z != 0);
|
||||
rt.setXAxis(rtx);
|
||||
rt.setYAxis(rty);
|
||||
rt.setZAxis(rtz);
|
||||
rtx.setEnabled(x != 0);
|
||||
rty.setEnabled(y != 0);
|
||||
rtz.setEnabled(z != 0);
|
||||
rtx.setInterval(90);
|
||||
rty.setInterval(90);
|
||||
rtz.setInterval(90);
|
||||
rtx.minMax(x);
|
||||
rty.minMax(y);
|
||||
rtz.minMax(z);
|
||||
rt.setXAxis(AxisRotationClamp.locked(x != 0, x, 90));
|
||||
rt.setYAxis(AxisRotationClamp.locked(y != 0, y, 90));
|
||||
rt.setZAxis(AxisRotationClamp.locked(z != 0, z, 90));
|
||||
|
||||
return rt;
|
||||
}
|
||||
@@ -182,12 +160,12 @@ public class IrisObjectRotation {
|
||||
return s;
|
||||
}
|
||||
|
||||
public double getRotation(int spin, IrisAxisRotationClamp clamp) {
|
||||
public double getRotation(int spin, AxisRotationClamp clamp) {
|
||||
if (!enabled) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!clamp.isEnabled()) {
|
||||
if (!clamp.enabled()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -457,14 +435,14 @@ public class IrisObjectRotation {
|
||||
|
||||
if (canRotateX()) {
|
||||
if (getXAxis().isLocked()) {
|
||||
if (Math.abs(getXAxis().getMax()) % 360D == 180D) {
|
||||
if (Math.abs(getXAxis().max()) % 360D == 180D) {
|
||||
v.setZ(-v.getZ());
|
||||
v.setY(-v.getY());
|
||||
} else if (getXAxis().getMax() % 360D == 90D || getXAxis().getMax() % 360D == -270D) {
|
||||
} else if (getXAxis().max() % 360D == 90D || getXAxis().max() % 360D == -270D) {
|
||||
double z = v.getZ();
|
||||
v.setZ(v.getY());
|
||||
v.setY(-z);
|
||||
} else if (getXAxis().getMax() == -90D || getXAxis().getMax() % 360D == 270D) {
|
||||
} else if (getXAxis().max() == -90D || getXAxis().max() % 360D == 270D) {
|
||||
double z = v.getZ();
|
||||
v.setZ(-v.getY());
|
||||
v.setY(z);
|
||||
@@ -478,14 +456,14 @@ public class IrisObjectRotation {
|
||||
|
||||
if (canRotateZ()) {
|
||||
if (getZAxis().isLocked()) {
|
||||
if (Math.abs(getZAxis().getMax()) % 360D == 180D) {
|
||||
if (Math.abs(getZAxis().max()) % 360D == 180D) {
|
||||
v.setY(-v.getY());
|
||||
v.setX(-v.getX());
|
||||
} else if (getZAxis().getMax() % 360D == 90D || getZAxis().getMax() % 360D == -270D) {
|
||||
} else if (getZAxis().max() % 360D == 90D || getZAxis().max() % 360D == -270D) {
|
||||
double y = v.getY();
|
||||
v.setY(v.getX());
|
||||
v.setX(-y);
|
||||
} else if (getZAxis().getMax() == -90D || getZAxis().getMax() % 360D == 270D) {
|
||||
} else if (getZAxis().max() == -90D || getZAxis().max() % 360D == 270D) {
|
||||
double y = v.getY();
|
||||
v.setY(-v.getX());
|
||||
v.setX(y);
|
||||
@@ -499,14 +477,14 @@ public class IrisObjectRotation {
|
||||
|
||||
if (canRotateY()) {
|
||||
if (getYAxis().isLocked()) {
|
||||
if (Math.abs(getYAxis().getMax()) % 360D == 180D) {
|
||||
if (Math.abs(getYAxis().max()) % 360D == 180D) {
|
||||
v.setX(-v.getX());
|
||||
v.setZ(-v.getZ());
|
||||
} else if (getYAxis().getMax() % 360D == 90D || getYAxis().getMax() % 360D == -270D) {
|
||||
} else if (getYAxis().max() % 360D == 90D || getYAxis().max() % 360D == -270D) {
|
||||
double x = v.getX();
|
||||
v.setX(v.getZ());
|
||||
v.setZ(-x);
|
||||
} else if (getYAxis().getMax() == -90D || getYAxis().getMax() % 360D == 270D) {
|
||||
} else if (getYAxis().max() == -90D || getYAxis().max() % 360D == 270D) {
|
||||
double x = v.getX();
|
||||
v.setX(-v.getZ());
|
||||
v.setZ(x);
|
||||
@@ -522,15 +500,15 @@ public class IrisObjectRotation {
|
||||
}
|
||||
|
||||
public boolean canRotateX() {
|
||||
return enabled && xAxis.isEnabled();
|
||||
return enabled && xAxis.enabled();
|
||||
}
|
||||
|
||||
public boolean canRotateY() {
|
||||
return enabled && yAxis.isEnabled();
|
||||
return enabled && yAxis.enabled();
|
||||
}
|
||||
|
||||
public boolean canRotateZ() {
|
||||
return enabled && zAxis.isEnabled();
|
||||
return enabled && zAxis.enabled();
|
||||
}
|
||||
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.procedural.coral;
|
||||
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectLimit;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisStiltSettings;
|
||||
import art.arcane.iris.engine.object.placement.IrisVacuumSettings;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
@@ -81,7 +81,7 @@ public class IrisCoral implements IrisProceduralPlacement {
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
|
||||
@Desc("Limit the max or min height of placement.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
|
||||
@Desc("Whether this coral may place on the terrain surface, under carvings, or both.")
|
||||
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
|
||||
@@ -93,10 +93,10 @@ public class IrisCoral implements IrisProceduralPlacement {
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
|
||||
@Desc("Settings for the stilt place modes (STILT, MIN_STILT, FAST_STILT, CENTER_STILT, ERODE_STILT, ORGANIC_STILT).")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
|
||||
@Desc("Settings for the vacuum place modes (VACUUM, VACUUM_HIGH, VACUUM_FAST, VACUUM_ORGANIC).")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
|
||||
@Desc("If true (default), every resolved coral block that is waterloggable is forced waterlogged so the coral does not die in water (coral fans, sea pickles and kelp also waterlog). Set false to place dead/dry coral.")
|
||||
private boolean waterlogged = true;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.procedural.crystal;
|
||||
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectLimit;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisStiltSettings;
|
||||
import art.arcane.iris.engine.object.placement.IrisVacuumSettings;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
@@ -81,7 +81,7 @@ public class IrisCrystal implements IrisProceduralPlacement {
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
|
||||
@Desc("Limit the max or min height of placement.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
|
||||
@Desc("Whether this crystal cluster may place on the terrain surface, under carvings, or both. Crystals are meant for caves, so this defaults to CARVING_ONLY.")
|
||||
private CarvingMode carvingSupport = CarvingMode.CARVING_ONLY;
|
||||
@@ -93,10 +93,10 @@ public class IrisCrystal implements IrisProceduralPlacement {
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
|
||||
@Desc("Settings for the stilt place modes (STILT, MIN_STILT, FAST_STILT, CENTER_STILT, ERODE_STILT, ORGANIC_STILT).")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
|
||||
@Desc("Settings for the vacuum place modes (VACUUM, VACUUM_HIGH, VACUUM_FAST, VACUUM_ORGANIC).")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
|
||||
@Desc("The surface this crystal grows from (FLOOR shards up, CEILING shards down, WALL shards outward). This orients the baked geometry only.")
|
||||
private IrisCrystalSurface growthSurface = IrisCrystalSurface.FLOOR;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.procedural.formation;
|
||||
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectLimit;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisStiltSettings;
|
||||
import art.arcane.iris.engine.object.placement.IrisVacuumSettings;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
@@ -81,7 +81,7 @@ public class IrisFormation implements IrisProceduralPlacement {
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
|
||||
@Desc("Limit the max or min height of placement.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
|
||||
@Desc("Whether this formation may place on the terrain surface, under carvings, or both.")
|
||||
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
|
||||
@@ -98,10 +98,10 @@ public class IrisFormation implements IrisProceduralPlacement {
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
|
||||
@Desc("Settings for the stilt place modes (STILT, MIN_STILT, FAST_STILT, CENTER_STILT, ERODE_STILT, ORGANIC_STILT).")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
|
||||
@Desc("Settings for the vacuum place modes (VACUUM, VACUUM_HIGH, VACUUM_FAST, VACUUM_ORGANIC).")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
|
||||
@Desc("The overall silhouette of the formation. Drives which sculpting routine the generator uses.")
|
||||
private IrisFormationForm form = IrisFormationForm.SPIRE;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.procedural.fungi;
|
||||
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectLimit;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisStiltSettings;
|
||||
import art.arcane.iris.engine.object.placement.IrisVacuumSettings;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
@@ -81,7 +81,7 @@ public class IrisFungus implements IrisProceduralPlacement {
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
|
||||
@Desc("Limit the max or min height of placement.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
|
||||
@Desc("Whether this fungus may place on the terrain surface, under carvings, or both.")
|
||||
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
|
||||
@@ -93,10 +93,10 @@ public class IrisFungus implements IrisProceduralPlacement {
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
|
||||
@Desc("Settings for the stilt place modes (STILT, MIN_STILT, FAST_STILT, CENTER_STILT, ERODE_STILT, ORGANIC_STILT).")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
|
||||
@Desc("Settings for the vacuum place modes (VACUUM, VACUUM_HIGH, VACUUM_FAST, VACUUM_ORGANIC).")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
|
||||
@Required
|
||||
@Desc("The stem block, e.g. minecraft:mushroom_stem. Ignored when stemPalette is set.")
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.procedural.ruin;
|
||||
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectLimit;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisStiltSettings;
|
||||
import art.arcane.iris.engine.object.placement.IrisVacuumSettings;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
@@ -83,7 +83,7 @@ public class IrisRuin implements IrisProceduralPlacement {
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
|
||||
@Desc("Limit the max or min terrain height at which this ruin may place.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
|
||||
@Desc("Whether this ruin may place on the terrain surface, under carvings (caves), or both. SURFACE_ONLY keeps ruins above ground.")
|
||||
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
|
||||
@@ -95,10 +95,10 @@ public class IrisRuin implements IrisProceduralPlacement {
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
|
||||
@Desc("Settings for the stilt place modes (STILT, MIN_STILT, FAST_STILT, CENTER_STILT, ERODE_STILT, ORGANIC_STILT).")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
|
||||
@Desc("Settings for the vacuum place modes (VACUUM, VACUUM_HIGH, VACUUM_FAST, VACUUM_ORGANIC).")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
|
||||
@Required
|
||||
@Desc("The primary structural block, e.g. minecraft:cobblestone or minecraft:stone_bricks. Ignored when blockPalette is set. This is the bulk material of the ruin before weathering swaps some of it out.")
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object.procedural.tree;
|
||||
|
||||
import art.arcane.iris.builtin.stilt.StiltSettings;
|
||||
import art.arcane.iris.builtin.vacuum.VacuumSettings;
|
||||
import art.arcane.iris.builtin.validate.ObjectLimit;
|
||||
import art.arcane.iris.engine.object.material.IrisMaterialPalette;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectLimit;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisStiltSettings;
|
||||
import art.arcane.iris.engine.object.placement.IrisVacuumSettings;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
@@ -86,7 +86,7 @@ public class IrisProceduralTree implements IrisProceduralPlacement {
|
||||
private IrisObjectRotation rotation = new IrisObjectRotation();
|
||||
|
||||
@Desc("Limit the max or min height of placement.")
|
||||
private IrisObjectLimit clamp = new IrisObjectLimit();
|
||||
private ObjectLimit clamp = new ObjectLimit();
|
||||
|
||||
@Desc("Whether this tree may place on the terrain surface, under carvings, or both.")
|
||||
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
|
||||
@@ -98,10 +98,10 @@ public class IrisProceduralTree implements IrisProceduralPlacement {
|
||||
private IrisObjectTranslate translate = new IrisObjectTranslate();
|
||||
|
||||
@Desc("Settings for the stilt place modes (STILT, MIN_STILT, FAST_STILT, CENTER_STILT, ERODE_STILT, ORGANIC_STILT).")
|
||||
private IrisStiltSettings stiltSettings;
|
||||
private StiltSettings stiltSettings;
|
||||
|
||||
@Desc("Settings for the vacuum place modes (VACUUM, VACUUM_HIGH, VACUUM_FAST, VACUUM_ORGANIC).")
|
||||
private IrisVacuumSettings vacuumSettings;
|
||||
private VacuumSettings vacuumSettings;
|
||||
|
||||
@Required
|
||||
@Desc("The trunk (log) block, e.g. minecraft:oak_log. Ignored when trunkPalette is set.")
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object.structure;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.engine.object.loot.IrisObjectLoot;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectReplace;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.structure.jigsaw.IrisJigsawBranchFailurePolicy;
|
||||
import art.arcane.iris.engine.object.structure.jigsaw.IrisJigsawCompatibility;
|
||||
@@ -96,9 +96,9 @@ public class IrisStructure extends IrisRegistrant {
|
||||
@Desc("The place mode used when stamping each piece object into the world.")
|
||||
private ObjectPlaceMode placeMode = ObjectPlaceMode.STRUCTURE_PIECE;
|
||||
|
||||
@ArrayType(min = 1, type = IrisObjectReplace.class)
|
||||
@ArrayType(min = 1, type = ObjectReplace.class)
|
||||
@Desc("Find-and-replace block edits applied to every piece of this structure, using the exact same syntax as an object's 'edit'. For example, replace stone bricks with obsidian.")
|
||||
private KList<IrisObjectReplace> edit = new KList<>();
|
||||
private KList<ObjectReplace> edit = new KList<>();
|
||||
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object.terrain;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.IrisSlopeClip;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiomeGeneratorLink;
|
||||
@@ -73,7 +73,7 @@ public final class IrisBiomeLayerGenerator {
|
||||
CNG hgen = heightGenerators.get(i);
|
||||
double d = hgen.fit(layer.getMinHeight(), layer.getMaxHeight(), wx / zoom, wz / zoom);
|
||||
|
||||
IrisSlopeClip sc = layer.getSlopeCondition();
|
||||
SlopeClip sc = layer.getSlopeCondition();
|
||||
|
||||
if (!sc.isDefault()) {
|
||||
if (!sc.isValid(complex.getSlopeStream().get(wx, wz))) {
|
||||
@@ -193,7 +193,7 @@ public final class IrisBiomeLayerGenerator {
|
||||
CNG hgen = heightGenerators.get(i);
|
||||
double d = hgen.fit(layer.getMinHeight(), layer.getMaxHeight(), wx / zoom, wz / zoom);
|
||||
|
||||
IrisSlopeClip sc = layer.getSlopeCondition();
|
||||
SlopeClip sc = layer.getSlopeCondition();
|
||||
|
||||
if (!sc.isDefault()) {
|
||||
if (!sc.isValid(complex.getSlopeStream().get(wx, wz))) {
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object.terrain;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.SlopeClip;
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import art.arcane.iris.engine.object.noise.NoiseStyle;
|
||||
import art.arcane.iris.engine.object.placement.IrisSlopeClip;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.ArrayType;
|
||||
@@ -65,7 +65,7 @@ public class IrisBiomePaletteLayer {
|
||||
@Desc("The max thickness of this layer")
|
||||
private int maxHeight = 1;
|
||||
@Desc("If set, this layer only shows where the terrain slope is within these bounds; outside them the layer is skipped entirely. Thickness is not scaled by slope.")
|
||||
private IrisSlopeClip slopeCondition = new IrisSlopeClip();
|
||||
private SlopeClip slopeCondition = new SlopeClip();
|
||||
@MinNumber(0.0001)
|
||||
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
|
||||
private double zoom = 5;
|
||||
|
||||
Reference in new issue
Block a user