mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 15:56:27 +00:00
Cleanup
This commit is contained in:
@@ -65,13 +65,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
return new FunctionStream<>(f, f2, helper);
|
||||
}
|
||||
|
||||
default ProceduralStream<Boolean> chance(double chance)
|
||||
{
|
||||
default ProceduralStream<Boolean> chance(double chance) {
|
||||
return of((x, z) -> getDouble(x, z) < chance, Interpolated.BOOLEAN);
|
||||
}
|
||||
|
||||
default ProceduralStream<Boolean> seededChance(RNG brng, long rootSeed, double chance)
|
||||
{
|
||||
default ProceduralStream<Boolean> seededChance(RNG brng, long rootSeed, double chance) {
|
||||
RNG rng = brng.nextParallelRNG(rootSeed - 3995L);
|
||||
return of((x, z) -> {
|
||||
double ch = getDouble(x, z);
|
||||
@@ -365,11 +363,10 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
return new FittedStream<T>(this, min, max);
|
||||
}
|
||||
|
||||
default ProceduralStream<Double> style(RNG rng, IrisStyledRange range)
|
||||
{
|
||||
default ProceduralStream<Double> style(RNG rng, IrisStyledRange range) {
|
||||
return ProceduralStream.of((x, z) -> {
|
||||
double d = getDouble(x, z);
|
||||
return range.get(rng,d, -d);
|
||||
return range.get(rng, d, -d);
|
||||
}, Interpolated.DOUBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.stream.interpolation;
|
||||
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.stream.BasicStream;
|
||||
import com.volmit.iris.engine.stream.ProceduralStream;
|
||||
import com.volmit.iris.util.function.NoiseProvider;
|
||||
|
||||
@@ -24,8 +24,6 @@ import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.stream.BasicStream;
|
||||
import com.volmit.iris.engine.stream.ProceduralStream;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class CachedStream2D<T> extends BasicStream<T> implements ProceduralStream<T> {
|
||||
private final ProceduralStream<T> stream;
|
||||
private final ConcurrentLinkedHashMap<Long, T> cache;
|
||||
@@ -52,8 +50,7 @@ public class CachedStream2D<T> extends BasicStream<T> implements ProceduralStrea
|
||||
|
||||
@Override
|
||||
public T get(double x, double z) {
|
||||
if(IrisComplex.cacheLock.get())
|
||||
{
|
||||
if (IrisComplex.cacheLock.get()) {
|
||||
return stream.get((int) x, (int) z);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user