Insane Loader Propagation

This commit is contained in:
Daniel Mills
2021-08-02 16:32:57 -04:00
parent 9fb4798c77
commit ffa5fd5b2a
34 changed files with 244 additions and 141 deletions

View File

@@ -61,6 +61,7 @@ public class CNG {
private double up;
private double down;
private double power;
private ProceduralStream<Double> customGenerator;
public NoiseGenerator getGen() {
return generator;
@@ -173,9 +174,14 @@ public class CNG {
this(random, NoiseType.SIMPLEX, opacity, octaves);
}
public CNG(RNG random, NoiseType t, double opacity, int octaves) {
public CNG(RNG random, NoiseType type, double opacity, int octaves) {
this(random, type.create(random.nextParallelRNG((long) ((1113334944L * opacity) + 12922 + octaves)).lmax()), opacity, octaves);
}
public CNG(RNG random, NoiseGenerator generator, double opacity, int octaves) {
customGenerator = null;
creates++;
noscale = t.equals(NoiseType.WHITE);
noscale = generator.isNoScale();
this.oct = octaves;
this.rng = random;
power = 1;
@@ -186,7 +192,7 @@ public class CNG {
down = 0;
up = 0;
fracture = null;
generator = t.create(random.nextParallelRNG(33).lmax());
this.generator = generator;
this.opacity = opacity;
this.injector = ADD;

View File

@@ -0,0 +1,48 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2021 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.volmit.iris.engine.noise;
import com.volmit.iris.engine.object.IrisExpression;
import com.volmit.iris.util.math.RNG;
public class ExpressionNoise implements NoiseGenerator{
private final RNG rng;
private final IrisExpression expression;
public ExpressionNoise(RNG rng, IrisExpression expression)
{
this.rng = rng;
this.expression = expression;
}
@Override
public double noise(double x) {
return expression.evaluate(rng, x, -1);
}
@Override
public double noise(double x, double z) {
return expression.evaluate(rng, x, z);
}
@Override
public double noise(double x, double y, double z) {
return expression.evaluate(rng, x, y, z);
}
}

View File

@@ -28,4 +28,9 @@ public interface NoiseGenerator {
default boolean isStatic() {
return false;
}
default boolean isNoScale()
{
return false;
}
}

View File

@@ -31,6 +31,11 @@ public class WhiteNoise implements NoiseGenerator {
return true;
}
public boolean isNoScale()
{
return true;
}
private double f(double m) {
return (m % 8192) * 1024;
}