mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 16:26:14 +00:00
Insane Loader Propagation
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,9 @@ public interface NoiseGenerator {
|
||||
default boolean isStatic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isNoScale()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user