9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-30 04:29:05 +00:00

Carving & undercarriage

This commit is contained in:
Daniel Mills
2020-10-31 19:24:25 -04:00
parent f2339f26ca
commit 7f3b9ec89a
9 changed files with 105 additions and 19 deletions

View File

@@ -34,6 +34,12 @@ public class IrisCarveLayer
@Desc("The max height")
private int maxHeight = 220;
@MinNumber(0.0)
@MaxNumber(1.0)
@DontObfuscate
@Desc("The full percentage means the 4D opacity of this carver will decay from 100% to 0% at the min & max vertical ranges. Setting the percent to 1.0 will make a very drastic & charp change at the edge of the vertical min & max. Where as 0.15 means only 15% of the vertical range will actually be 100% opacity.")
private double fullPercent = 0.5;
@MaxNumber(512)
@MinNumber(-128)
@DontObfuscate
@@ -55,7 +61,19 @@ public class IrisCarveLayer
return false;
}
double opacity = Math.pow(IrisInterpolation.sinCenter(M.lerpInverse(getMinHeight(), getMaxHeight(), y)), 4);
double innerRange = fullPercent * (maxHeight - minHeight);
double opacity = 1D;
if(y <= minHeight+innerRange)
{
opacity = IrisInterpolation.bezier(M.lerpInverse(getMinHeight(), minHeight+innerRange, y));
}
else if(y >=maxHeight - innerRange)
{
opacity = IrisInterpolation.bezier(1D - M.lerpInverse(maxHeight-innerRange, getMaxHeight(), y));
}
return cng.aquire(() -> getStyle().create(rng.nextParallelRNG(-2340 * getMaxHeight() * getMinHeight()))).fitDouble(0D, 1D, x, y, z) * opacity > getThreshold();
}
}

View File

@@ -1,5 +1,6 @@
package com.volmit.iris.object;
import net.royawesome.jlibnoise.Noise;
import org.bukkit.Material;
import org.bukkit.World.Environment;
import org.bukkit.block.data.BlockData;
@@ -62,6 +63,10 @@ public class IrisDimension extends IrisRegistrant
@Desc("Improves the biome grid variation by shuffling the cell grid more depending on the seed. This makes biomes across multiple seeds look far different than before.")
private boolean aggressiveBiomeReshuffle = false;
@DontObfuscate
@Desc("Instead of a flat bottom, applies a clamp (using this noise style) to the bottom instead of a flat bottom. Useful for carving out center-dimensions in a dimension composite world.")
private IrisShapedGeneratorStyle undercarriage = null;
@DontObfuscate
@Desc("Upon joining this world, Iris will send a resource pack request to the client. If they have previously selected yes, it will auto-switch depending on which dimension they go to.")
private String resourcePack = "";
@@ -367,6 +372,22 @@ public class IrisDimension extends IrisRegistrant
return rad.aquire(() -> Math.toRadians(dimensionAngleDeg));
}
public boolean isCarved(int x, int y, int z, RNG rng, int terrainHeight)
{
if(isCarving() && terrainHeight > getFluidHeight() || y < terrainHeight)
{
for(IrisCarveLayer j : getCarveLayers())
{
if(j.isCarved(rng, x, y, z))
{
return true;
}
}
}
return false;
}
public double sinRotate()
{
return sinr.aquire(() -> Math.sin(getDimensionAngle()));

View File

@@ -36,7 +36,6 @@ public class IrisShapedGeneratorStyle
@Required
@MinNumber(-256)
@MaxNumber(256)
@DontObfuscate
@Desc("The max block value")
private int max = 0;