diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java index 2b2b3dd54..7997f8d4f 100644 --- a/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java +++ b/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java @@ -30,9 +30,13 @@ public class IrisCeilingDecorator extends IrisEngineDecorator int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData()); stack = Math.min(max + 1, stack); + BlockData top = decorator.getBlockDataForTop(biome, getRng(), realX, realZ, getData()); + BlockData fill = decorator.getBlockData100(biome, getRng(), realX, realZ, getData()); + for(int i = 0; i < stack; i++) { - data.set(x, height-i, z, i == 0 ? decorator.getBlockDataForTop(biome, getRng(), realX, realZ, getData()) : decorator.getBlockData100(biome, getRng(), realX, realZ, getData())); + double threshold = (((double)i) / (double)(stack - 1)); + data.set(x, height-i, z, threshold >= decorator.getTopThreshold() ? top : fill); } } } diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java index d260c26c2..492add8ae 100644 --- a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java +++ b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java @@ -1,6 +1,5 @@ package com.volmit.iris.generator.decorator; -import com.volmit.iris.Iris; import com.volmit.iris.object.DecorationPart; import com.volmit.iris.object.IrisBiome; import com.volmit.iris.object.IrisDecorator; @@ -31,12 +30,14 @@ public class IrisSeaFloorDecorator extends IrisEngineDecorator { int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData()); stack = Math.min(stack, getDimension().getFluidHeight() - height + 2); - //Iris.info("Stack at " + realX + "," + realZ + " is " + stack); + BlockData top = decorator.getBlockDataForTop(biome, getRng(), realX, realZ, getData()); BlockData fill = decorator.getBlockData100(biome, getRng(), realX, realZ, getData()); + for(int i = 0; i < stack; i++) { - data.set(x, height+i, z, i == stack-1 ? top : fill); + double threshold = ((double)i) / (stack - 1); + data.set(x, height+i, z, threshold >= decorator.getTopThreshold() ? top : fill); } } } diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java index b3e59ef3a..5933e937b 100644 --- a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java +++ b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java @@ -30,9 +30,12 @@ public class IrisSeaSurfaceDecorator extends IrisEngineDecorator { int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData()); + BlockData top = decorator.getBlockDataForTop(biome, getRng(), realX, realZ, getData()); + BlockData fill = decorator.getBlockData100(biome, getRng(), realX, realZ, getData()); for(int i = 0; i < stack; i++) { - data.set(x, getDimension().getFluidHeight()+1+i, z, i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData())); + double threshold = ((double)i) / (stack - 1); + data.set(x, getDimension().getFluidHeight()+1+i, z, threshold >= decorator.getTopThreshold() ? top : fill); } } } diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java index 0d9633e46..d1ae3dd42 100644 --- a/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java +++ b/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java @@ -36,9 +36,13 @@ public class IrisShoreLineDecorator extends IrisEngineDecorator { int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData()); + BlockData top = decorator.getBlockDataForTop(biome, getRng(), realX, realZ, getData()); + BlockData fill = decorator.getBlockData100(biome, getRng(), realX, realZ, getData()); + for(int i = 0; i < stack; i++) { - data.set(x, height+1+i, z, i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData())); + double threshold = ((double)i) / (stack - 1); + data.set(x, height+1+i, z, threshold >= decorator.getTopThreshold() ? top : fill); } } } diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java index 3d2c01ad8..b3fea78ca 100644 --- a/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java +++ b/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java @@ -70,15 +70,13 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator } int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData()); + BlockData top = decorator.getBlockDataForTop(biome, getRng(), realX, realZ, getData()); + BlockData fill = decorator.getBlockData100(biome, getRng(), realX, realZ, getData()); for(int i = 0; i < stack; i++) { - bd = i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData()); - - if(bd == null && i == stack-1) - { - bd = decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData()); - } + double threshold = ((double)i) / (stack - 1); + bd = threshold >= decorator.getTopThreshold() ? top : fill; if(bd == null) { diff --git a/src/main/java/com/volmit/iris/object/IrisDecorator.java b/src/main/java/com/volmit/iris/object/IrisDecorator.java index 60b92d372..00cc6e8ac 100644 --- a/src/main/java/com/volmit/iris/object/IrisDecorator.java +++ b/src/main/java/com/volmit/iris/object/IrisDecorator.java @@ -72,6 +72,13 @@ public class IrisDecorator @Desc("The palette of blocks used at the very top of a 'stackMax' of higher than 1. For example, bamboo tops.") private KList topPalette = new KList(); + @DependsOn("topPalette") + @MinNumber(0.01) + @MaxNumber(1.0) + @DontObfuscate + @Desc("When the stack passes the top threshold, the top palette will start being used instead of the normal palette.") + private double topThreshold = 1.0; + private final transient AtomicCache layerGenerator = new AtomicCache<>(); private final transient AtomicCache varianceGenerator = new AtomicCache<>(); private final transient AtomicCache heightGenerator = new AtomicCache<>();