mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-12 18:56:14 +00:00
Cleanup and prevent crash error
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.scaffold.stream;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.scaffold.stream.arithmetic.*;
|
||||
import com.volmit.iris.scaffold.stream.convert.*;
|
||||
@@ -15,7 +16,13 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T>
|
||||
{
|
||||
public static ProceduralStream<Double> ofDouble(Function2<Double, Double, Double> f)
|
||||
{
|
||||
return of(f, Interpolated.DOUBLE);
|
||||
try {
|
||||
return of(f, Interpolated.DOUBLE);
|
||||
} catch (IncompatibleClassChangeError e){
|
||||
Iris.warn(f.toString());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static ProceduralStream<Double> ofDouble(Function3<Double, Double, Double, Double> f)
|
||||
|
||||
@@ -10,16 +10,16 @@ import java.util.function.Function;
|
||||
|
||||
public interface Interpolated<T>
|
||||
{
|
||||
public static final Interpolated<BlockData> BLOCK_DATA = of((t) -> 0D, (t) -> null);
|
||||
public static final Interpolated<KList<CaveResult>> CAVE_RESULTS = of((t) -> 0D, (t) -> null);
|
||||
public static final Interpolated<RNG> RNG = of((t) -> 0D, (t) -> null);
|
||||
public static final Interpolated<Double> DOUBLE = of((t) -> t, (t) -> t);
|
||||
public static final Interpolated<Integer> INT = of(Double::valueOf, Double::intValue);
|
||||
public static final Interpolated<Long> LONG = of(Double::valueOf, Double::longValue);
|
||||
Interpolated<BlockData> BLOCK_DATA = of((t) -> 0D, (t) -> null);
|
||||
Interpolated<KList<CaveResult>> CAVE_RESULTS = of((t) -> 0D, (t) -> null);
|
||||
Interpolated<RNG> RNG = of((t) -> 0D, (t) -> null);
|
||||
Interpolated<Double> DOUBLE = of((t) -> t, (t) -> t);
|
||||
Interpolated<Integer> INT = of(Double::valueOf, Double::intValue);
|
||||
Interpolated<Long> LONG = of(Double::valueOf, Double::longValue);
|
||||
|
||||
public double toDouble(T t);
|
||||
double toDouble(T t);
|
||||
|
||||
public T fromDouble(double d);
|
||||
T fromDouble(double d);
|
||||
|
||||
default InterpolatorFactory<T> interpolate()
|
||||
{
|
||||
@@ -31,7 +31,7 @@ public interface Interpolated<T>
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> Interpolated<T> of(Function<T, Double> a, Function<Double, T> b)
|
||||
static <T> Interpolated<T> of(Function<T, Double> a, Function<Double, T> b)
|
||||
{
|
||||
return new Interpolated<T>()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user