This commit is contained in:
Daniel Mills 2020-07-26 13:24:54 -04:00
parent 5af98c5683
commit 7505d645eb
6 changed files with 21 additions and 5 deletions

View File

@ -98,12 +98,12 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
sliver.set(k, block);
if(k == height && block.getMaterial().isSolid() && k < fluidHeight && biome.isSea())
if(k == height && block.getMaterial().isSolid() && k < fluidHeight)
{
decorateUnderwater(biome, sliver, wx, k, wz, rx, rz, block);
}
if(k == Math.max(height, fluidHeight) && block.getMaterial().isSolid() && k < 255 && !biome.isSea())
if(k == Math.max(height, fluidHeight) && block.getMaterial().isSolid() && k < 255 && k > fluidHeight)
{
decorateLand(biome, sliver, wx, k, wz, rx, rz, block);
}
@ -238,14 +238,14 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
if(stack == 1)
{
sliver.set(y + 1, d);
sliver.set(i.getPartOf().equals(DecorationPart.SEA_SURFACE) ? (getFluidHeight() + 1) : (y + 1), d);
}
else if(y < getFluidHeight() - stack)
{
for(int l = 0; l < stack; l++)
{
sliver.set(y + l + 1, d);
sliver.set(i.getPartOf().equals(DecorationPart.SEA_SURFACE) ? (getFluidHeight() + 1 + l) : (y + l + 1), d);
}
}
@ -363,6 +363,11 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
return isFluidAtHeight(rx + 1, rz) || isFluidAtHeight(rx - 1, rz) || isFluidAtHeight(rx, rz - 1) || isFluidAtHeight(rx, rz + 1);
}
public boolean isUnderwater(int x, int z)
{
return isFluidAtHeight(x, z);
}
public boolean isFluidAtHeight(int x, int z)
{
return Math.round(getTerrainHeight(x, z)) < getFluidHeight();

View File

@ -4,4 +4,5 @@ public enum DecorationPart
{
NONE,
SHORE_LINE,
SEA_SURFACE
}

View File

@ -23,7 +23,7 @@ public class IrisBiomeDecorator
@Desc("If this decorator has a height more than 1 this changes how it picks the height between your maxes. Scatter = random, Wispy = wavy heights")
private Dispersion verticalVariance = Dispersion.SCATTER;
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE")
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
private DecorationPart partOf = DecorationPart.NONE;
@Desc("The minimum repeat stack height (setting to 3 would stack 3 of <block> on top of each other")

View File

@ -134,6 +134,11 @@ public class IrisObject extends IrisRegistrant
int y = yv < 0 ? placer.getHighest(x, z, config.isUnderwater()) + config.getRotation().rotate(new BlockVector(0, getCenter().getBlockY(), 0), yf, xf, spinx, spiny, spinz).getBlockY() : yv;
KMap<ChunkPosition, Integer> heightmap = config.getSnow() > 0 ? new KMap<>() : null;
if(!config.isUnderwater() && !config.isOnwater() && placer.isUnderwater(x, z))
{
return;
}
for(BlockVector g : blocks.k())
{
BlockVector i = g.clone();

View File

@ -33,6 +33,9 @@ public class IrisObjectPlacement
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
private boolean underwater = false;
@Desc("If set to true, objects will place on the fluid height level Such as boats.")
private boolean onwater = false;
@Desc("If set to true, this object will only place parts of itself where blocks already exist.")
private boolean meld = false;

View File

@ -15,4 +15,6 @@ public interface IObjectPlacer
public boolean isPreventingDecay();
public boolean isSolid(int x, int y, int z);
public boolean isUnderwater(int x, int z);
}