diff --git a/build.gradle b/build.gradle index 54c6869c8..a3a08881f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'com.volmit.iris' -version '1.5.13' +version '1.5.14' def apiVersion = '1.17' def name = 'Iris' def main = 'com.volmit.iris.Iris' diff --git a/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java b/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java index a3cc30c66..58b1ad755 100644 --- a/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java +++ b/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java @@ -477,8 +477,7 @@ public class IrisPostModifier extends EngineAssignedModifier { BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData); return d instanceof Levelled; } - - + public void setPostBlock(int x, int y, int z, BlockData d, int currentPostX, int currentPostZ, Hunk currentData) { synchronized (currentData) { diff --git a/src/main/java/com/volmit/iris/engine/noise/CNG.java b/src/main/java/com/volmit/iris/engine/noise/CNG.java index 1d7c5ab41..984e3142b 100644 --- a/src/main/java/com/volmit/iris/engine/noise/CNG.java +++ b/src/main/java/com/volmit/iris/engine/noise/CNG.java @@ -347,35 +347,49 @@ public class CNG { } private double getNoise(double... dim) { - if (isTrueFracturing()) { - if (dim.length == 2) { - double scale = noscale ? 1 : this.bakedScale * this.scale; - double f1 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[0], dim[1]) - 0.5) * fscale : 0D); - double f2 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[1], dim[0]) - 0.5) * fscale : 0D); - double x = dim[0] + f1; - double y = dim[1] + -f1; - double z = 0D; - return generator.noise(x * scale, y * scale, z * scale) * opacity; - } else if (dim.length == 3) { - double scale = noscale ? 1 : this.bakedScale * this.scale; - double f1 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[0], dim[2], dim[1]) - 0.5) * fscale : 0D); - double f2 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[1], dim[0], dim[2]) - 0.5) * fscale : 0D); - double f3 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[2], dim[1], dim[0]) - 0.5) * fscale : 0D); - double x = dim[0] + f1; - double y = dim[1] + f3; - double z = dim[2] + f2; - return generator.noise(x * scale, y * scale, z * scale) * opacity; - } + double scale = noscale ? 1 : this.bakedScale * this.scale; + + if(fracture == null || noscale) + { + return generator.noise( + (dim.length > 0 ? dim[0] : 0D) * scale, + (dim.length > 1 ? dim[1] : 0D) * scale, + (dim.length > 2 ? dim[2] : 0D) * scale) * opacity; } - double scale = noscale ? 1 : this.bakedScale * this.scale; - double f = noscale ? 0 : (fracture != null ? (fracture.noise(dim) - 0.5) * fscale : 0D); + if (fracture.isTrueFracturing()) { + double x = dim.length > 0 ? dim[0] + ((fracture.noise(dim) - 0.5) * fscale) : 0D; + double y = dim.length > 1 ? dim[1] + ((fracture.noise(dim[1], dim[0]) - 0.5) * fscale) : 0D; + double z = dim.length > 2 ? dim[2] + ((fracture.noise(dim[2], dim[0], dim[1]) - 0.5) * fscale) : 0D; + return generator.noise(x * scale, y * scale, z * scale) * opacity; + } + + double f = fracture.noise(dim) * fscale; double x = dim.length > 0 ? dim[0] + f : 0D; - double y = dim.length > 1 ? dim[1] + -f : 0D; - double z = dim.length > 2 ? dim[2] + -f : 0D; + double y = dim.length > 1 ? dim[1] - f : 0D; + double z = dim.length > 2 ? dim[2] - f : 0D; return generator.noise(x * scale, y * scale, z * scale) * opacity; } + public double invertNoise(double... dim) { + if(dim.length == 1) + { + return noise(-dim[0]); + } + + else if(dim.length == 2) + { + return noise(dim[1], dim[0]); + } + + else if(dim.length == 3) + { + return noise(dim[1], dim[2], dim[0]); + } + + return noise(dim); + } + public double noise(double... dim) { double n = getNoise(dim); n = power != 1D ? (n < 0 ? -Math.pow(Math.abs(n), power) : Math.pow(n, power)) : n; diff --git a/src/main/java/com/volmit/iris/engine/object/IrisGeneratorStyle.java b/src/main/java/com/volmit/iris/engine/object/IrisGeneratorStyle.java index 6e4005510..723a127b1 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisGeneratorStyle.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisGeneratorStyle.java @@ -49,7 +49,7 @@ public class IrisGeneratorStyle { private double multiplier = 1; @Desc("If set to true, each dimension will be fractured with a different order of input coordinates. This is usually 2 or 3 times slower than normal.") - private boolean maxFractureAccuracy = false; + private boolean axialFracturing = false; @Desc("Apply a generator to the coordinate field fed into this parent generator. I.e. Distort your generator with another generator.") private IrisGeneratorStyle fracture = null; @@ -74,7 +74,7 @@ public class IrisGeneratorStyle { return cng.aquire(() -> { CNG cng = style.create(rng).bake().scale(1D / zoom).pow(exponent).bake(); - cng.setTrueFracturing(maxFractureAccuracy); + cng.setTrueFracturing(axialFracturing); if (fracture != null) { cng.fractureWith(fracture.create(rng.nextParallelRNG(2934)), fracture.getMultiplier());