Fix decorator issues

This commit is contained in:
Daniel Mills 2021-07-10 23:58:59 -04:00
parent 502f7de040
commit 76041a9f55
3 changed files with 31 additions and 4 deletions

View File

@ -24,7 +24,10 @@ public class IrisSeaFloorDecorator extends IrisEngineDecorator
{
if(!decorator.isStacking())
{
data.set(x, height, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
if(height >= 0 || height < getEngine().getHeight())
{
data.set(x, height, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
}
}
else
{
@ -36,6 +39,16 @@ public class IrisSeaFloorDecorator extends IrisEngineDecorator
for(int i = 0; i < stack; i++)
{
if(height - i < 0 || height - i > getEngine().getHeight())
{
continue;
}
if(height+i > getDimension().getFluidHeight())
{
continue;
}
double threshold = ((double)i) / (stack - 1);
data.set(x, height+i, z, threshold >= decorator.getTopThreshold() ? top : fill);
}

View File

@ -22,8 +22,12 @@ public class IrisSeaSurfaceDecorator extends IrisEngineDecorator
{
if(!decorator.isStacking())
{
data.set(x, getDimension().getFluidHeight()+1, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
if(height >= 0 || height < getEngine().getHeight())
{
data.set(x, getDimension().getFluidHeight()+1, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
}
}
else
{
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
@ -32,6 +36,11 @@ public class IrisSeaSurfaceDecorator extends IrisEngineDecorator
BlockData fill = decorator.getBlockData100(biome, getRng(), realX, realZ, getData());
for(int i = 0; i < stack; i++)
{
if(height - i < 0 || height - i > getEngine().getHeight())
{
continue;
}
double threshold = ((double)i) / (stack - 1);
data.set(x, getDimension().getFluidHeight() + 1 + i, z, threshold >= decorator.getTopThreshold() ? top : fill);
}

View File

@ -80,12 +80,17 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator
if(bd == null)
{
return;
break;
}
if(i == 0 && !underwater && !canGoOn(bd, bdx))
{
return;
break;
}
if(underwater && height + 1 + i > getDimension().getFluidHeight())
{
break;
}
data.set(x, height+1+i, z, bd);