mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Fixes
This commit is contained in:
parent
f3ece64635
commit
cf6f28aa3e
@ -77,11 +77,13 @@ public class IrisComplex implements DataProvider {
|
||||
private ProceduralStream<Biome> trueBiomeDerivativeStream;
|
||||
private ProceduralStream<Double> heightStream;
|
||||
private ProceduralStream<Double> heightStreamNoFeatures;
|
||||
private ProceduralStream<Double> heightDomainStreamNoFeatures;
|
||||
private ProceduralStream<Double> objectChanceStream;
|
||||
private ProceduralStream<Double> maxHeightStream;
|
||||
private ProceduralStream<Double> overlayStream;
|
||||
private ProceduralStream<Double> heightFluidStream;
|
||||
private ProceduralStream<Integer> trueHeightStream;
|
||||
private ProceduralStream<Integer> trueHeightDomainStream;
|
||||
private ProceduralStream<Double> slopeStream;
|
||||
private ProceduralStream<Integer> islandTopStream;
|
||||
private ProceduralStream<Integer> islandBottomStream;
|
||||
@ -227,6 +229,25 @@ public class IrisComplex implements DataProvider {
|
||||
IrisBiome b = focus != null ? focus : baseBiomeStream.get(x, z);
|
||||
return getHeight(engine, b, x, z, engine.getWorld().seed(), false);
|
||||
}, Interpolated.DOUBLE).clamp(0, engine.getHeight()).cache2D(cacheSize);
|
||||
heightDomainStreamNoFeatures = engine.getDimension().getVerticalDomain().isFlat()
|
||||
? heightStreamNoFeatures
|
||||
: ProceduralStream.of((x, z) -> {
|
||||
double hh = 0;
|
||||
double v, i;
|
||||
|
||||
for(i = 0; i < engine.getHeight(); i++)
|
||||
{
|
||||
double ox = engine.getDimension().getVerticalDomain().get(rng, getData(), i - 12345);
|
||||
double oz = engine.getDimension().getVerticalDomain().get(rng, getData(), i + 54321);
|
||||
v = heightStreamNoFeatures.get(x+ox, z+oz);
|
||||
if(v > hh)
|
||||
{
|
||||
hh = v;
|
||||
}
|
||||
}
|
||||
|
||||
return hh;
|
||||
}, Interpolated.DOUBLE).cache2D(cacheSize);
|
||||
slopeStream = heightStream.slope(3).cache2D(cacheSize);
|
||||
objectChanceStream = ProceduralStream.ofDouble((x, z) -> {
|
||||
if (engine.getDimension().hasFeatures(engine)) {
|
||||
@ -324,6 +345,7 @@ public class IrisComplex implements DataProvider {
|
||||
.convertAware2D((b, xx, zz) -> decorateFor(b, xx, zz, IrisDecorationPart.SEA_SURFACE)).cache2D(cacheSize);
|
||||
seaFloorDecoration = trueBiomeStream
|
||||
.convertAware2D((b, xx, zz) -> decorateFor(b, xx, zz, IrisDecorationPart.SEA_FLOOR)).cache2D(cacheSize);
|
||||
|
||||
trueHeightStream = ProceduralStream.of((x, z) -> {
|
||||
int rx = (int) Math.round(engine.modifyX(x));
|
||||
int rz = (int) Math.round(engine.modifyZ(z));
|
||||
@ -371,6 +393,26 @@ public class IrisComplex implements DataProvider {
|
||||
.get(x, z) : 0);
|
||||
islandBottomStream = islandStream.convertAware2D((i, x, z) ->
|
||||
i ? islandHeightStream.subtract(islandDepthStream).round().get(x, z) : 0);
|
||||
|
||||
trueHeightDomainStream = engine.getDimension().getVerticalDomain().isFlat()
|
||||
? trueHeightStream
|
||||
: ProceduralStream.of((x, z) -> {
|
||||
double hh = 0;
|
||||
double v, i;
|
||||
|
||||
for(i = 0; i < engine.getHeight(); i++)
|
||||
{
|
||||
double ox = engine.getDimension().getVerticalDomain().get(rng, getData(), i - 12345);
|
||||
double oz = engine.getDimension().getVerticalDomain().get(rng, getData(), i + 54321);
|
||||
v = trueHeightStream.get(x+ox, z+oz);
|
||||
if(v > hh)
|
||||
{
|
||||
hh = v;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)Math.round(hh);
|
||||
}, Interpolated.INT).cache2D(cacheSize);
|
||||
//@done
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisSlopeClip;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
|
@ -22,6 +22,7 @@ import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.noise.IrisGenerator;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
|
@ -39,6 +39,7 @@ import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructure;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisInterpolator;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
@ -315,9 +316,6 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("If true, the spawner system has infinite energy. This is NOT recommended because it would allow for mobs to keep spawning over and over without a rate limit")
|
||||
private boolean infiniteEnergy = false;
|
||||
|
||||
@Desc("If defined, warp the terrain vertically by this style. This will cause overhangs & carving-like shapes")
|
||||
private IrisShapedGeneratorStyle verticalDomain = new IrisShapedGeneratorStyle(NoiseStyle.FLAT, 1, 1);
|
||||
|
||||
@MinNumber(0.0001)
|
||||
@MaxNumber(512)
|
||||
@Desc("The rock zoom mostly for zooming in on a wispy palette")
|
||||
@ -332,6 +330,9 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("Cartographer map trade overrides")
|
||||
private IrisVillagerOverride patchCartographers = new IrisVillagerOverride().setDisableTrade(false);
|
||||
|
||||
@Desc("If defined, warp the terrain vertically by this style. This will cause overhangs & carving-like shapes")
|
||||
private IrisShapedGeneratorStyle verticalDomain = new IrisShapedGeneratorStyle(NoiseStyle.FLAT, 1, 1);
|
||||
|
||||
private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> fluidLayerGenerator = new AtomicCache<>();
|
||||
|
@ -38,13 +38,13 @@ import lombok.experimental.Accessors;
|
||||
public class IrisInterpolator {
|
||||
@Required
|
||||
@Desc("The interpolation method when two biomes use different heights but this same generator")
|
||||
private InterpolationMethod function = InterpolationMethod.BICUBIC;
|
||||
private InterpolationMethod function = InterpolationMethod.BILINEAR_STARCAST_6;
|
||||
|
||||
@Required
|
||||
@MinNumber(1)
|
||||
@MaxNumber(8192)
|
||||
@Desc("The range checked horizontally. Smaller ranges yeild more detail but are not as smooth.")
|
||||
private double horizontalScale = 3;
|
||||
private double horizontalScale = 7;
|
||||
|
||||
public double interpolate(double x, double z, NoiseProvider provider) {
|
||||
return interpolate((int) Math.round(x), (int) Math.round(z), provider);
|
||||
|
@ -34,6 +34,7 @@ import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSpawner;
|
||||
|
@ -32,6 +32,7 @@ public interface Interpolated<T> {
|
||||
Interpolated<KList<CaveResult>> CAVE_RESULTS = of((t) -> 0D, (t) -> null);
|
||||
Interpolated<RNG> RNG = of((t) -> 0D, (t) -> null);
|
||||
Interpolated<Double> DOUBLE = of((t) -> t, (t) -> t);
|
||||
Interpolated<Double[]> DOUBLE_ARRAY = of((t) -> 0D, (t) -> new Double[2]);
|
||||
Interpolated<Boolean> BOOLEAN = of((t) -> 0D, (t) -> false);
|
||||
Interpolated<Integer> INT = of(Double::valueOf, Double::intValue);
|
||||
Interpolated<Long> LONG = of(Double::valueOf, Double::longValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user