com/hypixel/hytale/procedurallib/NoiseFunction.java
package com.hypixel.hytale.procedurallib;
public interface NoiseFunction extends NoiseFunction2d , NoiseFunction3d {
}
com/hypixel/hytale/procedurallib/NoiseFunction2d.java
package com.hypixel.hytale.procedurallib;
@FunctionalInterface
public interface NoiseFunction2d {
double get (int var1, int var2, double var3, double var5) ;
}
com/hypixel/hytale/procedurallib/NoiseFunction3d.java
package com.hypixel.hytale.procedurallib;
@FunctionalInterface
public interface NoiseFunction3d {
double get (int var1, int var2, double var3, double var5, double var7) ;
}
com/hypixel/hytale/procedurallib/NoiseFunctionPair.java
package com.hypixel.hytale.procedurallib;
import javax.annotation.Nonnull;
public class NoiseFunctionPair implements NoiseFunction {
protected NoiseFunction2d noiseFunction2d;
protected NoiseFunction3d noiseFunction3d;
public NoiseFunctionPair () {
}
public NoiseFunctionPair (NoiseFunction2d noiseFunction2d, NoiseFunction3d noiseFunction3d) {
this .noiseFunction2d = noiseFunction2d;
this .noiseFunction3d = noiseFunction3d;
}
public NoiseFunction2d getNoiseFunction2d () {
return this .noiseFunction2d;
}
public void setNoiseFunction2d (NoiseFunction2d noiseFunction2d) {
this .noiseFunction2d = noiseFunction2d;
}
public NoiseFunction3d getNoiseFunction3d () {
return this .noiseFunction3d;
}
public void setNoiseFunction3d (NoiseFunction3d noiseFunction3d) {
this .noiseFunction3d = noiseFunction3d;
}
public double get (int seed, int offsetSeed, x, y) {
.noiseFunction2d.get(seed, offsetSeed, x, y);
}
{
.noiseFunction3d.get(seed, offsetSeed, x, y, z);
}
String {
String.valueOf( .noiseFunction2d);
+ var10000 + + String.valueOf( .noiseFunction3d) + ;
}
}
com/hypixel/hytale/procedurallib/NoiseType.java
package com.hypixel.hytale.procedurallib;
public enum NoiseType {
SIMPLEX,
OLD_SIMPLEX,
VALUE,
PERLIN,
CELL,
DISTANCE,
CONSTANT,
GRID,
MESH,
BRANCH,
POINT;
private NoiseType () {
}
}
com/hypixel/hytale/procedurallib/condition/BasicHeightThresholdInterpreter.java
package com.hypixel.hytale.procedurallib.condition;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class BasicHeightThresholdInterpreter implements IHeightThresholdInterpreter {
@Nonnull
protected final float [] interpolatedThresholds;
protected final int lowestNonOne;
protected final int highestNonZero;
public BasicHeightThresholdInterpreter (@Nonnull int [] positions, @Nonnull float [] thresholds, int length) {
if (positions.length != thresholds.length) {
throw new IllegalArgumentException (String.format("Mismatching array lengths! positions: %s, thresholds: %s" , positions.length, thresholds.length));
} else {
this .interpolatedThresholds = new float [length];
for (int y = 0 ; y < this .interpolatedThresholds.length; ++y) {
float threshold = thresholds[thresholds.length - 1 ];
( ; i < positions.length; ++i) {
(y < positions[i]) {
(i == ) {
threshold = thresholds[i];
} {
( )(y - positions[i - ]) / ( )(positions[i] - positions[i - ]);
threshold = IHeightThresholdInterpreter.lerp(thresholds[i - ], thresholds[i], distance);
}
;
}
}
.interpolatedThresholds[y] = threshold;
}
lowestNonOne;
(lowestNonOne = ; lowestNonOne < length && !( .interpolatedThresholds[lowestNonOne] < ); ++lowestNonOne) {
}
.lowestNonOne = lowestNonOne;
highestNonZero;
(highestNonZero = length - ; highestNonZero >= && !( .interpolatedThresholds[highestNonZero] > ); --highestNonZero) {
}
.highestNonZero = highestNonZero;
}
}
{
.lowestNonOne;
}
{
.highestNonZero;
}
{
;
}
{
.interpolatedThresholds.length;
}
{
.getThreshold(seed, x, y, height, .getContext(seed, x, y));
}
{
(height > .highestNonZero) {
;
} {
(height < ) {
height = ;
}
(height >= .interpolatedThresholds.length) {
height = .interpolatedThresholds.length - ;
}
.interpolatedThresholds[height];
}
}
String {
Arrays.toString( .interpolatedThresholds);
+ var10000 + + .lowestNonOne + + .highestNonZero + ;
}
{
;
}
}
com/hypixel/hytale/procedurallib/condition/ConstantBlockFluidCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class ConstantBlockFluidCondition implements IBlockFluidCondition {
public static final ConstantBlockFluidCondition DEFAULT_TRUE = new ConstantBlockFluidCondition (true );
public static final ConstantBlockFluidCondition DEFAULT_FALSE = new ConstantBlockFluidCondition (false );
protected final boolean result;
public ConstantBlockFluidCondition (boolean result) {
this .result = result;
}
public boolean eval (int block, int fluid) {
return this .result;
}
@Nonnull
public String toString () {
return "ConstantBlockFluidCondition{result=" + this .result + ;
}
}
com/hypixel/hytale/procedurallib/condition/ConstantIntCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class ConstantIntCondition implements IIntCondition {
public static final ConstantIntCondition DEFAULT_TRUE = new ConstantIntCondition (true );
public static final ConstantIntCondition DEFAULT_FALSE = new ConstantIntCondition (false );
protected final boolean result;
public ConstantIntCondition (boolean result) {
this .result = result;
}
public boolean getResult () {
return this .result;
}
public boolean eval (int value) {
return this .result;
}
@Nonnull
public String toString {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/condition/DefaultCoordinateCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class DefaultCoordinateCondition implements ICoordinateCondition {
public static final DefaultCoordinateCondition DEFAULT_TRUE = new DefaultCoordinateCondition (true );
public static final DefaultCoordinateCondition DEFAULT_FALSE = new DefaultCoordinateCondition (false );
protected final boolean result;
private DefaultCoordinateCondition (boolean result) {
this .result = result;
}
public boolean getResult () {
return this .result;
}
public boolean eval (int seed, int x, int y) {
return this .result;
}
public {
.result;
}
String {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/condition/DefaultCoordinateRndCondition.java
package com.hypixel.hytale.procedurallib.condition;
import java.util.Random;
import javax.annotation.Nonnull;
public class DefaultCoordinateRndCondition implements ICoordinateRndCondition {
public static final DefaultCoordinateRndCondition DEFAULT_TRUE = new DefaultCoordinateRndCondition (true );
public static final DefaultCoordinateRndCondition DEFAULT_FALSE = new DefaultCoordinateRndCondition (false );
protected final boolean result;
public DefaultCoordinateRndCondition (boolean result) {
this .result = result;
}
public boolean getResult () {
return this .result;
}
public boolean eval (int seed, int x, int z, int y, Random random) {
return .result;
}
String {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/condition/DefaultDoubleCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class DefaultDoubleCondition implements IDoubleCondition {
public static final DefaultDoubleCondition DEFAULT_TRUE = new DefaultDoubleCondition (true );
public static final DefaultDoubleCondition DEFAULT_FALSE = new DefaultDoubleCondition (false );
protected final boolean result;
public DefaultDoubleCondition (boolean result) {
this .result = result;
}
public boolean getResult () {
return this .result;
}
public boolean eval (double value) {
return this .result;
}
@Nonnull
public String toString {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/condition/DefaultDoubleThresholdCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class DefaultDoubleThresholdCondition implements IDoubleThreshold {
public static final DefaultDoubleThresholdCondition DEFAULT_TRUE = new DefaultDoubleThresholdCondition (true );
public static final DefaultDoubleThresholdCondition DEFAULT_FALSE = new DefaultDoubleThresholdCondition (false );
protected final boolean result;
public DefaultDoubleThresholdCondition (boolean result) {
this .result = result;
}
public boolean isResult () {
return this .result;
}
public boolean eval (double d) {
return this .result;
}
public boolean {
.result;
}
String {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/condition/DoubleThreshold.java
package com.hypixel.hytale.procedurallib.condition;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class DoubleThreshold {
public DoubleThreshold () {
}
public static class Single implements IDoubleThreshold {
protected final double min;
protected final double max;
protected final double halfRange;
public Single (double min, double max) {
this .min = min;
this .max = max;
this .halfRange = (max - min) * 0.5 ;
}
public boolean eval (double d) {
return this .min <= d && d <= this .max;
}
public boolean eval (double d, double factor) {
double t0 .min + .halfRange * factor;
.max - .halfRange * factor;
t0 <= d && d <= t1;
}
String {
+ .min + + .max + + .halfRange + ;
}
}
{
Single[] singles;
{
.singles = singles;
}
{
(Single single : .singles) {
(single.eval(d)) {
;
}
}
;
}
{
(Single single : .singles) {
(single.eval(d, factor)) {
;
}
}
;
}
String {
+ Arrays.toString( .singles) + ;
}
}
}
com/hypixel/hytale/procedurallib/condition/DoubleThresholdCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class DoubleThresholdCondition implements IDoubleCondition {
protected final IDoubleThreshold threshold;
public DoubleThresholdCondition (IDoubleThreshold threshold) {
this .threshold = threshold;
}
public boolean eval (double value) {
return this .threshold.eval(value);
}
@Nonnull
public String toString () {
return "DoubleThresholdCondition{threshold=" + String.valueOf(this .threshold) + "}" ;
}
}
com/hypixel/hytale/procedurallib/condition/HeightCondition.java
package com.hypixel.hytale.procedurallib.condition;
import java.util.Random;
import javax.annotation.Nonnull;
public class HeightCondition implements ICoordinateRndCondition {
protected final IHeightThresholdInterpreter interpreter;
public HeightCondition (IHeightThresholdInterpreter interpreter) {
this .interpreter = interpreter;
}
public boolean eval (int seed, int x, int z, int y, @Nonnull Random random) {
double threshold = (double )this .interpreter.getThreshold(seed, (double )x, (double )z, y);
return threshold > 0.0 && (threshold >= 1.0 || threshold > random.nextDouble());
}
@Nonnull
public String toString () {
return "HeightCondition{interpreter=" + String.valueOf(this .interpreter) + "}" ;
}
}
com/hypixel/hytale/procedurallib/condition/HeightThresholdCoordinateCondition.java
package com.hypixel.hytale.procedurallib.condition;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import javax.annotation.Nonnull;
public class HeightThresholdCoordinateCondition implements ICoordinateCondition {
private final IHeightThresholdInterpreter interpreter;
public HeightThresholdCoordinateCondition (IHeightThresholdInterpreter interpreter) {
this .interpreter = interpreter;
}
public boolean eval (int seed, int x, int y) {
throw new UnsupportedOperationException ("This needs a height to operate." );
}
public boolean eval (int seed, int x, int y, int z) {
return (double )this .interpreter.getThreshold(seed, (double )x, (double )z, y) >= HashUtil.random((long )seed, (long )GeneralNoise.fastFloor((double )x), (long )GeneralNoise.fastFloor((double )y), (long )GeneralNoise.fastFloor(( )z));
}
String {
+ String.valueOf( .interpreter) + ;
}
}
com/hypixel/hytale/procedurallib/condition/IBlockFluidCondition.java
package com.hypixel.hytale.procedurallib.condition;
public interface IBlockFluidCondition {
boolean eval (int var1, int var2) ;
}
com/hypixel/hytale/procedurallib/condition/ICoordinateCondition.java
package com.hypixel.hytale.procedurallib.condition;
public interface ICoordinateCondition {
boolean eval (int var1, int var2, int var3) ;
boolean eval (int var1, int var2, int var3, int var4) ;
}
com/hypixel/hytale/procedurallib/condition/ICoordinateRndCondition.java
package com.hypixel.hytale.procedurallib.condition;
import java.util.Random;
public interface ICoordinateRndCondition {
boolean eval (int var1, int var2, int var3, int var4, Random var5) ;
}
com/hypixel/hytale/procedurallib/condition/IDoubleCondition.java
package com.hypixel.hytale.procedurallib.condition;
import java.util.function.IntToDoubleFunction;
import javax.annotation.Nonnull;
public interface IDoubleCondition {
boolean eval (double var1) ;
default boolean eval (int seed, @Nonnull IntToDoubleFunction seedFunction) {
return this .eval(seedFunction.applyAsDouble(seed));
}
}
com/hypixel/hytale/procedurallib/condition/IDoubleThreshold.java
package com.hypixel.hytale.procedurallib.condition;
public interface IDoubleThreshold {
boolean eval (double var1) ;
boolean eval (double var1, double var3) ;
}
com/hypixel/hytale/procedurallib/condition/IHeightThresholdInterpreter.java
package com.hypixel.hytale.procedurallib.condition;
public interface IHeightThresholdInterpreter {
int getLowestNonOne () ;
int getHighestNonZero () ;
float getThreshold (int var1, double var2, double var4, int var6) ;
float getThreshold (int var1, double var2, double var4, int var6, double var7) ;
double getContext (int var1, double var2, double var4) ;
int getLength () ;
default boolean isSpawnable (int height) {
return height >= this .getLowestNonOne() && height <= this .getHighestNonZero();
}
static float lerp (float from, float to, float t) {
return from + (to - from) * t;
}
}
com/hypixel/hytale/procedurallib/condition/IIntCondition.java
package com.hypixel.hytale.procedurallib.condition;
import com.hypixel.hytale.procedurallib.util.IntToIntFunction;
import javax.annotation.Nonnull;
public interface IIntCondition {
boolean eval (int var1) ;
default boolean eval (int seed, @Nonnull IntToIntFunction seedFunction) {
return this .eval(seedFunction.applyAsInt(seed));
}
}
com/hypixel/hytale/procedurallib/condition/NoiseHeightThresholdInterpreter.java
package com.hypixel.hytale.procedurallib.condition;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class NoiseHeightThresholdInterpreter implements IHeightThresholdInterpreter {
protected final NoiseProperty noise;
@Nonnull
protected final float [] keys;
@Nonnull
protected final IHeightThresholdInterpreter[] values;
protected final int length;
protected final int lowestNonOne;
protected final int highestNonZero;
public NoiseHeightThresholdInterpreter (NoiseProperty noise, @Nonnull float [] keys, @Nonnull IHeightThresholdInterpreter[] values) {
if (keys.length != values.length) {
throw new IllegalStateException ("Length of keys and values are different!" );
} else {
checkInterpreterLength(values);
this .noise = noise;
this .keys = keys;
this .values = values;
this .length = values[ ].getLength();
;
(IHeightThresholdInterpreter value : values) {
(value.getLowestNonOne() < lowestNonOne) {
lowestNonOne = value.getLowestNonOne();
}
}
.lowestNonOne = lowestNonOne;
.length - ;
(IHeightThresholdInterpreter value : values) {
(value.getHighestNonZero() > highestNonZero) {
highestNonZero = value.getHighestNonZero();
}
}
.highestNonZero = highestNonZero;
}
}
{
.lowestNonOne;
}
{
.highestNonZero;
}
{
.noise.get(seed, x, y);
}
{
.noise(seed, x, y);
}
{
.length;
}
{
.getThreshold(seed, x, z, height, .getContext(seed, x, z));
}
{
(height > .highestNonZero) {
;
} {
.keys.length;
( ; i < length; ++i) {
(context <= ( ) .keys[i]) {
(i == ) {
.values[ ].getThreshold(seed, x, z, height);
}
(( )context - .keys[i - ]) / ( .keys[i] - .keys[i - ]);
IHeightThresholdInterpreter.lerp( .values[i - ].getThreshold(seed, x, z, height), .values[i].getThreshold(seed, x, z, height), distance);
}
}
.values[length - ].getThreshold(seed, x, z, height);
}
}
{
from + (to - from) * t;
}
{
values[ ].getLength();
( ; i < values.length; ++i) {
(values[i].getLength() != length) {
( );
}
}
}
String {
String.valueOf( .noise);
+ var10000 + + Arrays.toString( .keys) + + Arrays.toString( .values) + + .length + + .lowestNonOne + + .highestNonZero + ;
}
}
com/hypixel/hytale/procedurallib/condition/NoiseMaskCondition.java
package com.hypixel.hytale.procedurallib.condition;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import javax.annotation.Nonnull;
public class NoiseMaskCondition implements ICoordinateCondition {
protected final NoiseProperty noiseMask;
protected final IDoubleCondition condition;
public NoiseMaskCondition (NoiseProperty noiseMask, IDoubleCondition condition) {
this .noiseMask = noiseMask;
this .condition = condition;
}
public boolean eval (int seed, int x, int y) {
return this .condition.eval(this .noiseMask.get(seed, (double )x, (double )y));
}
public boolean eval (int seed, int x, int y, int z) {
return this .condition.eval(this .noiseMask.get(seed, (double )x, (double )y, (double )z));
}
@Nonnull
public String toString () {
String.valueOf( .noiseMask);
+ var10000 + + String.valueOf( .condition) + ;
}
}
com/hypixel/hytale/procedurallib/condition/SingleDoubleCondition.java
package com.hypixel.hytale.procedurallib.condition;
import javax.annotation.Nonnull;
public class SingleDoubleCondition implements IDoubleCondition {
protected final double value;
public SingleDoubleCondition (double value) {
this .value = value;
}
public boolean eval (double value) {
return value < this .value;
}
@Nonnull
public String toString () {
return "SingleDoubleCondition{value=" + this .value + "}" ;
}
}
com/hypixel/hytale/procedurallib/json/AbstractCellJitterJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public abstract class AbstractCellJitterJsonLoader <K extends SeedResource , T> extends JsonLoader <K, T> {
public AbstractCellJitterJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed, dataFolder, json);
}
@Nonnull
protected CellJitter loadJitter () {
double defaultJitter = this .loadDefaultJitter();
double x = this .loadJitterX(defaultJitter);
double y = this .loadJitterY(defaultJitter);
double z = this .loadJitterZ(defaultJitter);
return CellJitter.of(x, y, z);
}
protected double loadDefaultJitter () {
return loadJitter(this , "Jitter" , );
}
{
loadJitter( , , defaultJitter);
}
{
loadJitter( , , defaultJitter);
}
{
loadJitter( , , defaultJitter);
}
{
!loader.has(key) ? defaultJitter : loader.get(key).getAsDouble();
}
}
com/hypixel/hytale/procedurallib/json/BasicHeightThresholdInterpreterJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.BasicHeightThresholdInterpreter;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class BasicHeightThresholdInterpreterJsonLoader <K extends SeedResource > extends JsonLoader <K, BasicHeightThresholdInterpreter> {
protected final int length;
public BasicHeightThresholdInterpreterJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, int length) {
super (seed.append(".BasicHeightThresholdInterpreter" ), dataFolder, json);
this .length = length;
}
@Nonnull
public BasicHeightThresholdInterpreter load () {
return new BasicHeightThresholdInterpreter (this .loadPositions(), this .loadValues(), this .length);
}
protected int [] loadPositions() {
if (!this .has("Positions" )) {
throw new IllegalStateException ( );
} {
.get( ).getAsJsonArray();
[] positions = [terrainNoiseKeyPositionsJson.size()];
( ; i < positions.length; ++i) {
positions[i] = terrainNoiseKeyPositionsJson.get(i).getAsInt();
}
positions;
}
}
[] loadValues() {
(! .has( )) {
( );
} {
.get( ).getAsJsonArray();
[] thresholds = [terrainNoiseKeyThresholdsJson.size()];
( ; i < thresholds.length; ++i) {
thresholds[i] = terrainNoiseKeyThresholdsJson.get(i).getAsFloat();
}
thresholds;
}
}
{
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/BlendNoisePropertyJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.hypixel.hytale.procedurallib.property.BlendNoiseProperty;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlendNoisePropertyJsonLoader <K extends SeedResource > extends JsonLoader <K, BlendNoiseProperty> {
public BlendNoisePropertyJsonLoader (SeedString<K> seed, Path dataFolder, @Nullable JsonElement json) {
super (seed, dataFolder, json);
}
@Nonnull
public BlendNoiseProperty load () {
NoiseProperty alpha = this .loadAlpha();
NoiseProperty[] noise = this .loadNoise();
double [] thresholds = this .loadThresholds();
validate(noise, thresholds);
return new BlendNoiseProperty (alpha, noise, thresholds);
}
protected NoiseProperty loadAlpha () {
return (new NoisePropertyJsonLoader ( .seed, .dataFolder, .mustGetObject( , (JsonObject) ))).load();
}
NoiseProperty[] loadNoise() {
.mustGetArray( , BlendNoisePropertyJsonLoader.Constants.EMPTY_ARRAY);
NoiseProperty[] noises = [noise.size()];
( ; i < noise.size(); ++i) {
noises[i] = ( ( .seed, .dataFolder, noise.get(i))).load();
}
noises;
}
[] loadThresholds() {
.mustGetArray( , BlendNoisePropertyJsonLoader.Constants.EMPTY_ARRAY);
[] values = [thresholds.size()];
( ; i < thresholds.size(); ++i) {
values[i] = ((Number)mustGet( + i, thresholds.get(i), (Object) , Number.class, JsonLoader::isNumber, JsonElement::getAsNumber)).doubleValue();
}
values;
}
{
(noises.length != thresholds.length) {
( );
} {
- / ;
( ; i < thresholds.length; ++i) {
(thresholds[i] <= previous) {
( );
}
previous = thresholds[i];
}
}
}
{
;
;
;
();
}
}
com/hypixel/hytale/procedurallib/json/BranchNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.ConstantIntCondition;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.BranchNoise;
import com.hypixel.hytale.procedurallib.logic.DistanceNoise;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellPointFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellType;
import com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode;
import com.hypixel.hytale.procedurallib.logic.cell.GridCellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.HexCellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.BranchEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.DensityPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.property.NoiseFormulaProperty;
import com.hypixel.hytale.procedurallib.supplier.DoubleRange;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import java.nio.file.Path;
import java.util.function.Function;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BranchNoiseJsonLoader <T extends > <T, BranchNoise> {
{
(seed, dataFolder, json);
}
BranchNoise {
.seed.get();
.loadParentCellType();
getCellDistanceFunction(parentCellType);
.loadParentEvaluator();
.loadDouble( , );
.loadRange( , );
.loadParentDensity();
DistanceNoise. .loadParentDistance2Function();
NoiseFormulaProperty.NoiseFormula. .loadParentFormula();
.loadLineCellType();
getCellPointFunction(lineCellType);
.loadDouble( , );
.loadRange( , );
getCellDistanceFunction(lineCellType);
.loadLineEvaluator(parentFunction, linePointFunction, lineScale);
(parentFunction, parentEvaluator, parentValue, parentFade, parentDensity, parentDistanceType, parentFormula, lineFunction, lineEvaluator, lineScale, lineThickness, resource);
}
CellType {
(CellType) .loadEnum( , CellType::valueOf, BranchNoiseJsonLoader.Constant.DEFAULT_PARENT_CELL_TYPE);
}
CellType {
(CellType) .loadEnum( , CellType::valueOf, BranchNoiseJsonLoader.Constant.DEFAULT_LINE_CELL_TYPE);
}
PointEvaluator {
.loadDouble( , );
.loadDouble( , defaultJitter);
.loadDouble( , defaultJitter);
CellJitter.of(jitterX, jitterY, );
(DistanceCalculationMode) .loadEnum( , DistanceCalculationMode::valueOf, BranchNoiseJsonLoader.Constant.DEFAULT_PARENT_DISTANCE_CAL_MODE);
PointEvaluator.of(distanceMode.getFunction(), (IDoubleCondition) , (IDoubleRange) , jitter);
}
IIntCondition {
ConstantIntCondition.DEFAULT_TRUE;
( .has( )) {
( ( .seed, .dataFolder, .get( ))).load();
density = DensityPointEvaluator.getDensityCondition(densityRange);
}
density;
}
DistanceNoise.Distance2Function {
((DistanceNoise.Distance2Mode) .loadEnum( , DistanceNoise.Distance2Mode::valueOf, BranchNoiseJsonLoader.Constant.DEFAULT_PARENT_DISTANCE_TYPE)).getFunction();
}
NoiseFormulaProperty.NoiseFormula.Formula {
((NoiseFormulaProperty.NoiseFormula) .loadEnum( , NoiseFormulaProperty.NoiseFormula::valueOf, BranchNoiseJsonLoader.Constant.DEFAULT_PARENT_FORMULA)).getFormula();
}
PointEvaluator {
.loadDouble( , );
.loadDouble( , defaultJitter);
.loadDouble( , defaultJitter);
CellJitter.of(jitterX, jitterY, );
BranchEvaluator. (BranchEvaluator.Direction) .loadEnum( , BranchEvaluator.Direction::valueOf, BranchNoiseJsonLoader.Constant.DEFAULT_LINE_DIRECTION);
(parentFunction, linePointFunction, direction, jitter, lineScale);
}
{
! .has(key) ? def : .get(key).getAsDouble();
}
IDoubleRange {
(IDoubleRange)(! .has(key) ? .Constant(def) : ( ( .seed, .dataFolder, .get(key))).load());
}
<E <E>> E {
(E)(! .has(key) ? def : (Enum)valueOf.apply( .get(key).getAsString()));
}
CellDistanceFunction {
Object var10000;
(cellType) {
SQUARE -> var10000 = GridCellDistanceFunction.DISTANCE_FUNCTION;
HEX -> var10000 = HexCellDistanceFunction.DISTANCE_FUNCTION;
-> ((String) , (Throwable) );
}
(CellDistanceFunction)var10000;
}
CellPointFunction {
CellPointFunction var10000;
(cellType) {
SQUARE -> var10000 = GridCellDistanceFunction.POINT_FUNCTION;
HEX -> var10000 = HexCellDistanceFunction.POINT_FUNCTION;
-> ((String) , (Throwable) );
}
var10000;
}
{
SeedResource seedResource;
{
(parentFunction, parentEvaluator, parentValue, parentFade, parentDensity, distance2Function, noiseFormula, lineFunction, lineEvaluator, lineScale, lineThickness);
.seedResource = seedResource;
}
ResultBuffer.ResultBuffer2d {
.seedResource.localBuffer2d();
}
String {
String.valueOf( .seedResource);
+ var10000 + + String.valueOf( .parentFunction) + + String.valueOf( .parentEvaluator) + + .parentValue + + String.valueOf( .parentFade) + + String.valueOf( .distance2Function) + + String.valueOf( .noiseFormula) + + String.valueOf( .lineFunction) + + String.valueOf( .lineEvaluator) + + .lineScale + + String.valueOf( .lineThickness) + ;
}
}
{
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
CellType.SQUARE;
CellType.SQUARE;
BranchEvaluator. BranchEvaluator.Direction.OUTWARD;
DistanceCalculationMode.EUCLIDEAN;
DistanceNoise. DistanceNoise.Distance2Mode.DIV;
NoiseFormulaProperty. NoiseFormulaProperty.NoiseFormula.SQRT;
}
}
com/hypixel/hytale/procedurallib/json/CellBorderDistanceFunctionJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.logic.cell.BorderDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.MeasurementMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class CellBorderDistanceFunctionJsonLoader <K extends SeedResource > extends JsonLoader <K, BorderDistanceFunction> {
protected final CellDistanceFunction distanceFunction;
public CellBorderDistanceFunctionJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json, CellDistanceFunction distanceFunction) {
super (seed, dataFolder, json);
this .distanceFunction = distanceFunction;
}
@Nonnull
public BorderDistanceFunction load () {
return new BorderDistanceFunction (this .distanceFunction, this .loadPointEvaluator(), this .loadDensity());
}
@Nullable
protected PointEvaluator {
( ( .seed, .dataFolder, .json, MeasurementMode.BORDER_DISTANCE, (PointDistanceFunction) )).load();
}
IDoubleCondition {
( ( .seed, .dataFolder, .json)).loadDensity();
}
}
com/hypixel/hytale/procedurallib/json/CellDistanceFunctionJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellType;
import com.hypixel.hytale.procedurallib.logic.cell.GridCellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.HexCellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.MeasurementMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class CellDistanceFunctionJsonLoader <K extends SeedResource > extends JsonLoader <K, CellDistanceFunction> {
protected final MeasurementMode measurementMode;
protected final PointDistanceFunction pointDistanceFunction;
public CellDistanceFunctionJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, @Nullable PointDistanceFunction pointDistanceFunction) {
this (seed, dataFolder, json, MeasurementMode.CENTRE_DISTANCE, pointDistanceFunction);
}
public CellDistanceFunctionJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, MeasurementMode measurementMode, @Nullable PointDistanceFunction pointDistanceFunction) {
super (seed.append(".CellDistanceFunction" ), dataFolder, json);
.measurementMode = measurementMode;
.pointDistanceFunction = pointDistanceFunction;
}
CellDistanceFunction {
.loadDistanceFunction();
Object var10000;
( .measurementMode) {
CENTRE_DISTANCE -> var10000 = distanceFunction;
BORDER_DISTANCE -> var10000 = ( ( .seed, .dataFolder, .json, distanceFunction)).load();
-> ((String) , (Throwable) );
}
(CellDistanceFunction)var10000;
}
CellType {
CellNoiseJsonLoader.Constants.DEFAULT_CELL_TYPE;
( .has( )) {
cellType = CellType.valueOf( .get( ).getAsString());
}
cellType;
}
CellDistanceFunction {
Object var10000;
( .loadCellType()) {
SQUARE -> var10000 = GridCellDistanceFunction.DISTANCE_FUNCTION;
HEX -> var10000 = HexCellDistanceFunction.DISTANCE_FUNCTION;
-> ((String) , (Throwable) );
}
(CellDistanceFunction)var10000;
}
}
com/hypixel/hytale/procedurallib/json/CellNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.CellNoise;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellType;
import com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class CellNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public CellNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".CellNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
CellDistanceFunction cellDistanceFunction = this .loadCellDistanceFunction();
PointEvaluator pointEvaluator .loadPointEvaluator();
CellNoise. .loadCellFunction();
.loadNoiseLookup();
(cellDistanceFunction, pointEvaluator, cellFunction, noiseLookup, .seed.get());
}
CellDistanceFunction {
( ( .seed, .dataFolder, .json, (PointDistanceFunction) )).load();
}
PointEvaluator {
( ( .seed, .dataFolder, .json)).load();
}
CellNoise.CellFunction {
CellNoise. CellNoiseJsonLoader.Constants.DEFAULT_CELL_MODE;
( .has( )) {
cellMode = CellNoise.CellMode.valueOf( .get( ).getAsString());
}
cellMode.getFunction();
}
NoiseProperty {
;
( .has( )) {
noiseProperty = ( ( .seed, .dataFolder, .get( ))).load();
}
noiseProperty;
}
{
SeedResource seedResource;
{
(cellDistanceFunction, pointEvaluator, cellFunction, noiseLookup);
.seedResource = seedResource;
}
ResultBuffer.ResultBuffer2d {
.seedResource.localBuffer2d();
}
ResultBuffer.ResultBuffer3d {
.seedResource.localBuffer3d();
}
}
{
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
DistanceCalculationMode.EUCLIDEAN;
CellNoise. CellNoise.CellMode.CELL_VALUE;
CellType.SQUARE;
}
}
com/hypixel/hytale/procedurallib/json/ConstantNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.ConstantNoise;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class ConstantNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public ConstantNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".ConstantNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
return new ConstantNoise (this .loadValue());
}
protected double loadValue () {
return this .has("Value" ) ? this .get("Value" ).getAsDouble() : 0.5 ;
}
public interface Constants {
String KEY_VALUE = "Value" ;
double ;
}
}
com/hypixel/hytale/procedurallib/json/CoordinateRandomizerJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import com.hypixel.hytale.procedurallib.random.CoordinateRandomizer;
import com.hypixel.hytale.procedurallib.random.CoordinateRotator;
import com.hypixel.hytale.procedurallib.random.ICoordinateRandomizer;
import com.hypixel.hytale.procedurallib.random.RotatedCoordinateRandomizer;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class CoordinateRandomizerJsonLoader <K extends SeedResource > extends JsonLoader <K, ICoordinateRandomizer> {
public CoordinateRandomizerJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed, dataFolder, json);
}
@Nonnull
public ICoordinateRandomizer load () {
return this .json != null && !this .json.isJsonNull() ? this .loadRandomizer() : CoordinateRandomizer.EMPTY_RANDOMIZER;
}
@Nonnull
protected ICoordinateRandomizer loadRandomizer () {
ICoordinateRandomizer randomizer = new ( .loadGenerators( ), .loadGenerators( ), .loadGenerators( ));
( .has( )) {
( ( .seed, .dataFolder, .get( ))).load();
(rotation != CoordinateRotator.NONE) {
randomizer = (randomizer, rotation);
}
}
randomizer;
}
CoordinateRandomizer.AmplitudeNoiseProperty[] loadGenerators( String seedSuffix) {
.get( ).getAsJsonArray();
CoordinateRandomizer.AmplitudeNoiseProperty[] generators = .AmplitudeNoiseProperty[array.size()];
( ; i < array.size(); ++i) {
array.get(i).getAsJsonObject();
( ( .seed.alternateOriginal(String.format(seedSuffix, i)), .dataFolder, object)).load();
object.get( ).getAsDouble();
generators[i] = .AmplitudeNoiseProperty(property, amplitude);
}
generators;
}
{
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/CoordinateRotatorJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.random.CoordinateOriginRotator;
import com.hypixel.hytale.procedurallib.random.CoordinateRotator;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class CoordinateRotatorJsonLoader <K extends SeedResource > extends JsonLoader <K, CoordinateRotator> {
public CoordinateRotatorJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed, dataFolder, json);
}
@Nonnull
public CoordinateRotator load () {
double pitch = this .has("Pitch" ) ? this .get("Pitch" ).getAsDouble() * 0.01745329238474369 : 0.0 ;
double yaw = this .has("Yaw" ) ? this .get("Yaw" ).getAsDouble() * 0.01745329238474369 : 0.0 ;
if (pitch == 0.0 && yaw == 0.0 ) {
return CoordinateRotator.NONE;
} else {
.has( ) ? .get( ).getAsDouble() : ;
.has( ) ? .get( ).getAsDouble() : ;
.has( ) ? .get( ).getAsDouble() : ;
(CoordinateRotator)(originX == && originY == && originZ == ? (pitch, yaw) : (pitch, yaw, originX, originY, originZ));
}
}
{
;
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/CurveNoisePropertyJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.property.CurveNoiseProperty;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.nio.file.Path;
import java.util.function.DoubleUnaryOperator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class CurveNoisePropertyJsonLoader <K extends SeedResource > extends JsonLoader <K, CurveNoiseProperty> {
@Nullable
protected final NoiseProperty noise;
public CurveNoisePropertyJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json, @Nullable NoiseProperty noise) {
super (seed, dataFolder, json);
this .noise = noise;
}
@Nonnull
public CurveNoiseProperty load () {
return new CurveNoiseProperty (this .loadNoise(), this .loadDCurve());
}
@Nullable
protected NoiseProperty loadNoise () {
NoiseProperty noise = this .noise;
if (noise == ) {
( .has( )) {
( ( .seed, .dataFolder, .get( ))).load();
} {
( );
}
} {
noise;
}
}
DoubleUnaryOperator {
.loadValue( , );
.loadValue( , - );
.PowerCurve(a, b);
}
{
def;
( .has(key)) {
value = .get(key).getAsDouble();
}
value;
}
{
;
;
;
;
- ;
}
}
com/hypixel/hytale/procedurallib/json/DistanceNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.DistanceNoise;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.MeasurementMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class DistanceNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public DistanceNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".DistanceNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
CellDistanceFunction cellDistanceFunction = this .loadCellDistanceFunction();
PointEvaluator pointEvaluator = this .loadPointEvaluator();
DistanceNoise.Distance2Function .loadDistance2Function();
(cellDistanceFunction, pointEvaluator, distance2Function, .seed.get());
}
CellDistanceFunction {
.loadMeasurementMode();
( ( .seed, .dataFolder, .json, measurementMode, (PointDistanceFunction) )).load();
}
PointEvaluator {
( ( .seed, .dataFolder, .json)).load();
}
MeasurementMode {
.has( ) ? MeasurementMode.valueOf( .get( ).getAsString()) : DistanceNoiseJsonLoader.Constants.DEFAULT_MEASUREMENT;
}
DistanceNoise.Distance2Function {
DistanceNoise. DistanceNoiseJsonLoader.Constants.DEFAULT_DISTANCE_2_MODE;
( .has( )) {
distance2Mode = DistanceNoise.Distance2Mode.valueOf( .get( ).getAsString());
}
distance2Mode.getFunction();
}
{
SeedResource seedResource;
{
(cellDistanceFunction, pointEvaluator, distance2Function);
.seedResource = seedResource;
}
ResultBuffer.ResultBuffer2d {
.seedResource.localBuffer2d();
}
ResultBuffer.ResultBuffer3d {
.seedResource.localBuffer3d();
}
}
{
;
;
MeasurementMode.CENTRE_DISTANCE;
DistanceNoise. DistanceNoise.Distance2Mode.SUB;
}
}
com/hypixel/hytale/procedurallib/json/DoubleConditionJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.DefaultDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.DoubleThresholdCondition;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.SingleDoubleCondition;
import java.nio.file.Path;
import java.util.Objects;
import javax.annotation.Nonnull;
public class DoubleConditionJsonLoader <K extends SeedResource > extends JsonLoader <K, IDoubleCondition> {
protected final Boolean defaultValue;
public DoubleConditionJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
this (seed.append(".DoubleCondition" ), dataFolder, json, true );
}
public DoubleConditionJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json, Boolean defaultValue) {
super (seed, dataFolder, json);
this .defaultValue = defaultValue;
}
@Nonnull
public IDoubleCondition load () {
if (this .json != null && !this .json.isJsonNull()) {
if (! .json.isJsonPrimitive() && (! .json.isJsonArray() || .json.getAsJsonArray().size() != || ! .json.getAsJsonArray().get( ).isJsonPrimitive())) {
( .json.isJsonArray()) {
(( ( .seed, .dataFolder, .json)).load());
} {
(String.format( , .json));
}
} {
.json.getAsDouble();
(limit);
}
} {
Objects.requireNonNull( .defaultValue, );
.defaultValue ? DefaultDoubleCondition.DEFAULT_TRUE : DefaultDoubleCondition.DEFAULT_FALSE;
}
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/json/DoubleRangeJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.supplier.DoubleRange;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import java.nio.file.Path;
import java.util.Objects;
import javax.annotation.Nonnull;
public class DoubleRangeJsonLoader <K extends SeedResource > extends JsonLoader <K, IDoubleRange> {
protected final double default1;
protected final double default2;
@Nonnull
protected final DoubleToDoubleFunction function;
public DoubleRangeJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
this (seed, dataFolder, json, 0.0 , (d) -> d);
}
public DoubleRangeJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, DoubleToDoubleFunction function) {
this (seed, dataFolder, json, 0.0 , function);
}
public DoubleRangeJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, double default1) {
(seed, dataFolder, json, default1, default1, (d) -> d);
}
{
(seed, dataFolder, json, default1, default1, function);
}
{
(seed, dataFolder, json, default1, default2, (d) -> d);
}
{
(seed.append( ), dataFolder, json);
.default1 = default1;
.default2 = default2;
.function = (DoubleToDoubleFunction)Objects.requireNonNull(function);
}
IDoubleRange {
( .json != && ! .json.isJsonNull()) {
( .json.isJsonArray()) {
.json.getAsJsonArray();
(array.size() != && array.size() != ) {
(String.format( , array.size()));
} {
(IDoubleRange)(array.size() == ? .Constant( .function.get(array.get( ).getAsDouble())) : .Normal( .function.get(array.get( ).getAsDouble()), .function.get(array.get( ).getAsDouble())));
}
} ( .json.isJsonObject()) {
( .has( ) && .has( )) {
.loadThreshold();
} (! .has( )) {
( );
} (! .has( )) {
( );
} {
.get( ).getAsDouble();
.get( ).getAsDouble();
.Normal( .function.get(min), .function.get(max));
}
} {
.Constant( .function.get( .json.getAsDouble()));
}
} {
(IDoubleRange)( .default1 == .default2 ? .Constant( .function.get( .default1)) : .Normal( .function.get( .default1), .function.get( .default2)));
}
}
IDoubleRange {
.get( ).getAsJsonArray();
.get( ).getAsJsonArray();
[] thresholds = [thresholdsJson.size()];
[] values = [thresholdsJson.size()];
( ; i < thresholds.length; ++i) {
thresholds[i] = thresholdsJson.get(i).getAsDouble();
values[i] = valuesJson.get(i).getAsDouble();
}
.Multiple(thresholds, values);
}
{
;
;
;
;
;
;
;
}
{
;
}
}
com/hypixel/hytale/procedurallib/json/DoubleThresholdJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.DefaultDoubleThresholdCondition;
import com.hypixel.hytale.procedurallib.condition.DoubleThreshold;
import com.hypixel.hytale.procedurallib.condition.IDoubleThreshold;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class DoubleThresholdJsonLoader <K extends SeedResource > extends JsonLoader <K, IDoubleThreshold> {
protected final boolean defaultValue;
public DoubleThresholdJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
this (seed, dataFolder, json, true );
}
public DoubleThresholdJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, boolean defaultValue) {
super (seed.append(".DoubleThreshold" ), dataFolder, json);
this .defaultValue = defaultValue;
}
@Nonnull
public IDoubleThreshold load () {
if (this .json != null && !this .json.isJsonNull()) {
if ( .json.isJsonPrimitive()) {
.json.getAsDouble();
.Single( , value);
} {
.json.getAsJsonArray();
(jsonArray.size() <= ) {
( );
} (jsonArray.get( ).isJsonArray()) {
DoubleThreshold.Single[] entries = .Single[jsonArray.size()];
( ; i < entries.length; ++i) {
jsonArray.get(i).getAsJsonArray();
(jsonArrayEntry.size() != ) {
( );
}
entries[i] = .Single(jsonArrayEntry.get( ).getAsDouble(), jsonArrayEntry.get( ).getAsDouble());
}
.Multiple(entries);
} (jsonArray.size() != ) {
( );
} {
.Single(jsonArray.get( ).getAsDouble(), jsonArray.get( ).getAsDouble());
}
}
} {
.defaultValue ? DefaultDoubleThresholdCondition.DEFAULT_TRUE : DefaultDoubleThresholdCondition.DEFAULT_FALSE;
}
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/json/FloatRangeJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.supplier.FloatRange;
import com.hypixel.hytale.procedurallib.supplier.IFloatRange;
import java.nio.file.Path;
import java.util.Objects;
import javax.annotation.Nonnull;
public class FloatRangeJsonLoader <K extends SeedResource > extends JsonLoader <K, IFloatRange> {
protected final float default1;
protected final float default2;
@Nonnull
protected final FloatToFloatFunction function;
public FloatRangeJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
this (seed, dataFolder, json, 0.0F , (d) -> d);
}
public FloatRangeJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, FloatToFloatFunction function) {
this (seed, dataFolder, json, 0.0F , function);
}
public FloatRangeJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, float default1) {
(seed, dataFolder, json, default1, default1, (d) -> d);
}
{
(seed, dataFolder, json, default1, default1, function);
}
{
(seed, dataFolder, json, default1, default2, (d) -> d);
}
{
(seed.append( ), dataFolder, json);
.default1 = default1;
.default2 = default2;
.function = (FloatToFloatFunction)Objects.requireNonNull(function);
}
IFloatRange {
( .json != && ! .json.isJsonNull()) {
( .json.isJsonArray()) {
.json.getAsJsonArray();
(array.size() != && array.size() != ) {
(String.format( , array.size()));
} {
(IFloatRange)(array.size() == ? .Constant( .function.get(array.get( ).getAsFloat())) : .Normal( .function.get(array.get( ).getAsFloat()), .function.get(array.get( ).getAsFloat())));
}
} ( .json.isJsonObject()) {
(! .has( )) {
( );
} (! .has( )) {
( );
} {
.get( ).getAsFloat();
.get( ).getAsFloat();
.Normal( .function.get(min), .function.get(max));
}
} {
.Constant( .function.get( .json.getAsFloat()));
}
} {
(IFloatRange)( .default1 == .default2 ? .Constant( .function.get( .default1)) : .Normal( .function.get( .default1), .function.get( .default2)));
}
}
{
;
;
;
;
;
}
{
;
}
}
com/hypixel/hytale/procedurallib/json/GradientNoisePropertyJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.property.GradientNoiseProperty;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class GradientNoisePropertyJsonLoader <K extends SeedResource > extends JsonLoader <K, GradientNoiseProperty> {
protected final NoiseProperty noise;
public GradientNoisePropertyJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json, NoiseProperty noise) {
super (seed, dataFolder, json);
this .noise = noise;
}
@Nonnull
public GradientNoiseProperty load () {
return new GradientNoiseProperty (this .noise, this .loadMode(), this .loadDistance(), this .loadNormalization());
}
@Nonnull
protected GradientNoiseProperty.GradientMode loadMode () {
GradientNoiseProperty.GradientMode mode = GradientNoisePropertyJsonLoader.Constants.DEFAULT_MODE;
if (this .has("Mode" )) {
mode = GradientNoiseProperty.GradientMode.valueOf( .get( ).getAsString());
}
mode;
}
{
;
( .has( )) {
distance = .get( ).getAsDouble();
}
distance;
}
{
;
( .has( )) {
distance = .get( ).getAsDouble();
}
distance;
}
{
;
;
;
GradientNoiseProperty. GradientNoiseProperty.GradientMode.MAGNITUDE;
;
;
}
}
com/hypixel/hytale/procedurallib/json/GridNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.GridNoise;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class GridNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public GridNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".GridNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
double defaultThickness = this .loadDefaultThickness();
return new GridNoise (this .loadThicknessX(defaultThickness), this .loadThicknessY(defaultThickness), this .loadThicknessZ(defaultThickness));
}
protected double loadDefaultThickness () {
return !this .has("Thickness" ) ? 0.0 / 0.0 : this .get("Thickness" ).getAsDouble();
}
{
.loadThickness( , defaultThickness);
}
{
.loadThickness( , defaultThickness);
}
{
(Double.isNaN(defaultThickness)) {
defaultThickness = ;
}
.loadThickness( , defaultThickness);
}
{
defaultThickness;
( .has(key)) {
value = .get(key).getAsDouble();
}
(Double.isNaN(value)) {
(String.format( , key));
} {
value;
}
}
{
/ ;
;
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/HeightThresholdInterpreterJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.IHeightThresholdInterpreter;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class HeightThresholdInterpreterJsonLoader <K extends SeedResource > extends JsonLoader <K, IHeightThresholdInterpreter> {
protected final int length;
public HeightThresholdInterpreterJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, int length) {
super (seed.append(".HeightThresholdInterpreter" ), dataFolder, json);
this .length = length;
}
@Nonnull
public IHeightThresholdInterpreter load () {
return (IHeightThresholdInterpreter)(NoiseHeightThresholdInterpreterJsonLoader.shouldHandle(this .json.getAsJsonObject()) ? (new NoiseHeightThresholdInterpreterJsonLoader (this .seed, this .dataFolder, this .json, this .length)).load() : (new BasicHeightThresholdInterpreterJsonLoader (this .seed, this .dataFolder, this .json, this .length)).load());
}
}
com/hypixel/hytale/procedurallib/json/JsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.function.Function;
import java.util.function.Predicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public abstract class JsonLoader <K extends SeedResource , T> extends Loader <K, T> {
@Nullable
protected final JsonElement json;
public JsonLoader (SeedString<K> seed, Path dataFolder, @Nullable JsonElement json) {
super (seed, dataFolder);
if (json != null && json.isJsonObject() && json.getAsJsonObject().has("File" )) {
this .json = this .loadFileConstructor(json.getAsJsonObject().get("File" ).getAsString());
} else {
this .json = json;
}
}
public boolean has (String name) {
return .json != && .json.isJsonObject() && .json.getAsJsonObject().has(name);
}
JsonElement {
( .json != && .json.isJsonObject()) {
.json.getAsJsonObject().get(name);
(element != && element.isJsonObject()) {
element.getAsJsonObject();
(object.has( )) {
element = .loadFileElem(object.get( ).getAsString());
}
}
element;
} {
;
}
}
JsonElement {
.json != && .json.isJsonObject() ? .json.getAsJsonObject().get(name) : ;
}
JsonElement {
.dataFolder.resolve(filePath.replace( , File.separatorChar) + );
{
(Files.newBufferedReader(file));
JsonElement var4;
{
var4 = JsonParser.parseReader(reader);
} (Throwable var7) {
{
reader.close();
} (Throwable var6) {
var7.addSuppressed(var6);
}
var7;
}
reader.close();
var4;
} (Throwable e) {
( + file.toString(), e);
}
}
JsonElement {
.loadFile(filePath);
}
JsonElement {
.loadFile(filePath);
}
JsonObject {
(JsonObject) .mustGet(key, defaultValue, JsonObject.class, JsonElement::isJsonObject, JsonElement::getAsJsonObject);
}
JsonArray {
(JsonArray) .mustGet(key, defaultValue, JsonArray.class, JsonElement::isJsonArray, JsonElement::getAsJsonArray);
}
String {
(String) .mustGet(key, defaultValue, String.class, JsonLoader::isString, JsonElement::getAsString);
}
Boolean {
(Boolean) .mustGet(key, defaultValue, Boolean.class, JsonLoader::isBoolean, JsonElement::getAsBoolean);
}
Number {
(Number) .mustGet(key, defaultValue, Number.class, JsonLoader::isNumber, JsonElement::getAsNumber);
}
<V> V {
(V)mustGet(key, .get(key), defaultValue, type, predicate, mapper);
}
<V> V {
(element == ) {
(defaultValue != ) {
defaultValue;
} {
error( , key);
}
} (!predicate.test(element)) {
error( , key, type.getSimpleName());
} {
(V)mapper.apply(element);
}
}
Error {
(String.format(format, args));
}
Error {
(String.format(format, args), parent);
}
{
element.isJsonPrimitive() && element.getAsJsonPrimitive().isString();
}
{
element.isJsonPrimitive() && element.getAsJsonPrimitive().isNumber();
}
{
element.isJsonPrimitive() && element.getAsJsonPrimitive().isBoolean();
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/json/Loader.java
package com.hypixel.hytale.procedurallib.json;
import java.nio.file.Path;
import javax.annotation.Nullable;
public abstract class Loader <K extends SeedResource , T> {
protected SeedString<K> seed;
protected final Path dataFolder;
public Loader (SeedString<K> seed, Path dataFolder) {
this .seed = seed;
this .dataFolder = dataFolder;
}
public SeedString<K> getSeed () {
return this .seed;
}
public Path getDataFolder () {
return this .dataFolder;
}
@Nullable
public abstract T load () ;
}
com/hypixel/hytale/procedurallib/json/MeshNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.condition.DoubleThresholdCondition;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.HexMeshNoise;
import com.hypixel.hytale.procedurallib.logic.MeshNoise;
import com.hypixel.hytale.procedurallib.logic.cell.CellType;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.DensityPointEvaluator;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class MeshNoiseJsonLoader <K extends SeedResource > extends AbstractCellJitterJsonLoader <K, NoiseFunction> {
public MeshNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".MeshNoise" ), dataFolder, json);
}
public NoiseFunction load () {
Object var10000;
switch (this .loadCellType()) {
case SQUARE -> var10000 = this .loadGridMeshNoise();
case HEX -> var10000 = this .loadHexMeshNoise();
default -> throw new MatchException ((String)null , (Throwable) );
}
(NoiseFunction)var10000;
}
MeshNoise {
.loadDefaultJitter();
( .loadDensity(), .loadThickness(), .loadJitterX(defaultJitter), .loadJitterY(defaultJitter));
}
HexMeshNoise {
( .loadDensity(), .loadThickness(), .loadJitter(), .loadLinesX(), .loadLinesY(), .loadLinesZ());
}
CellType {
CellNoiseJsonLoader.Constants.DEFAULT_CELL_TYPE;
( .has( )) {
cellType = CellType.valueOf( .get( ).getAsString());
}
cellType;
}
{
(! .has( )) {
( );
} {
.get( ).getAsDouble();
}
}
IIntCondition {
DensityPointEvaluator.getDensityCondition( .has( ) ? (( ( .seed, .dataFolder, .get( ))).load()) : );
}
{
.loadLinesFlag( , );
}
{
.loadLinesFlag( , );
}
{
.loadLinesFlag( , );
}
{
! .has(key) ? defaulValue : .get(key).getAsBoolean();
}
{
;
;
;
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/NoiseFunctionJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class NoiseFunctionJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public NoiseFunctionJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".NoiseFunction" ), dataFolder, json);
}
public NoiseFunction load () {
if (!this .has("NoiseType" )) {
throw new IllegalStateException (String.format("Could not find noise type for noise map! Keyword: %s" , "NoiseType" ));
} else {
NoiseTypeJson noiseTypeJson = NoiseTypeJson.valueOf(this .get("NoiseType" ).getAsString());
return (NoiseFunction)this .newLoader(noiseTypeJson).load();
}
}
@Nonnull
protected JsonLoader<K, NoiseFunction> newLoader (@Nonnull NoiseTypeJson noiseTypeJson) {
noiseTypeJson.newLoader( .seed, .dataFolder, .json);
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/json/NoiseHeightThresholdInterpreterJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.hypixel.hytale.procedurallib.condition.IHeightThresholdInterpreter;
import com.hypixel.hytale.procedurallib.condition.NoiseHeightThresholdInterpreter;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class NoiseHeightThresholdInterpreterJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseHeightThresholdInterpreter> {
protected final int length;
public NoiseHeightThresholdInterpreterJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, int length) {
super (seed.append(".NoiseHeightThresholdInterpreter" ), dataFolder, json);
this .length = length;
}
@Nonnull
public NoiseHeightThresholdInterpreter load () {
IHeightThresholdInterpreter[] interpreters = this .loadInterpreters();
float [] keys = this .loadKeys();
if (keys.length != interpreters.length) {
throw new IllegalArgumentException ( );
} {
( .loadNoise(), keys, interpreters);
}
}
NoiseProperty {
(! .has( )) {
( );
} {
( ( .seed, .dataFolder, .get( ))).load();
}
}
IHeightThresholdInterpreter[] loadInterpreters() {
(! .has( )) {
( );
} {
.get( ).getAsJsonArray();
IHeightThresholdInterpreter[] interpreters = [array.size()];
( ; i < interpreters.length; ++i) {
interpreters[i] = ( ( .seed.append( + i), .dataFolder, array.get(i), .length)).load();
}
interpreters;
}
}
[] loadKeys() {
(! .has( )) {
( );
} {
.get( ).getAsJsonArray();
[] keys = [array.size()];
( ; i < keys.length; ++i) {
keys[i] = array.get(i).getAsFloat();
}
keys;
}
}
{
jsonObject.has( );
}
{
;
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/NoiseMaskConditionJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.DefaultCoordinateCondition;
import com.hypixel.hytale.procedurallib.condition.ICoordinateCondition;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.NoiseMaskCondition;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class NoiseMaskConditionJsonLoader <K extends SeedResource > extends JsonLoader <K, ICoordinateCondition> {
protected final boolean defaultValue;
public NoiseMaskConditionJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
this (seed, dataFolder, json, true );
}
public NoiseMaskConditionJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json, boolean defaultValue) {
super (seed.append(".NoiseMaskCondition" ), dataFolder, json);
this .defaultValue = defaultValue;
}
@Nonnull
public ICoordinateCondition load () {
ICoordinateCondition mapCondition .defaultValue ? DefaultCoordinateCondition.DEFAULT_TRUE : DefaultCoordinateCondition.DEFAULT_FALSE;
( .json != && ! .json.isJsonNull()) {
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .json)).load();
( ( .seed, .dataFolder, .get( ))).load();
mapCondition = (noise, threshold);
}
mapCondition;
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/json/NoisePropertyJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.property.DistortedNoiseProperty;
import com.hypixel.hytale.procedurallib.property.FractalNoiseProperty;
import com.hypixel.hytale.procedurallib.property.InvertNoiseProperty;
import com.hypixel.hytale.procedurallib.property.MaxNoiseProperty;
import com.hypixel.hytale.procedurallib.property.MinNoiseProperty;
import com.hypixel.hytale.procedurallib.property.MultiplyNoiseProperty;
import com.hypixel.hytale.procedurallib.property.NoiseFormulaProperty;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import com.hypixel.hytale.procedurallib.property.NoisePropertyType;
import com.hypixel.hytale.procedurallib.property.NormalizeNoiseProperty;
import com.hypixel.hytale.procedurallib.property.OffsetNoiseProperty;
import com.hypixel.hytale.procedurallib.property.RotateNoiseProperty;
import com.hypixel.hytale.procedurallib.property.ScaleNoiseProperty;
import com.hypixel.hytale.procedurallib.property.SingleNoiseProperty;
import com.hypixel.hytale.procedurallib.property.SumNoiseProperty;
import com.hypixel.hytale.procedurallib.random.CoordinateRotator;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import java.nio.file.Path;
import java.util.Arrays;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class NoisePropertyJsonLoader <K extends SeedResource > extends <K, NoiseProperty> {
{
(seed.append( ), dataFolder, json);
}
NoiseProperty {
;
NoiseProperty noiseProperty;
( .has( )) {
type = NoisePropertyType.valueOf( .get( ).getAsString());
(type) {
MAX:
(! .has( )) {
( );
}
NoiseProperty[] noiseProperties = .loadNoiseProperties( .get( ));
noiseProperty = (noiseProperties);
;
MIN:
(! .has( )) {
( );
}
NoiseProperty[] noiseProperties = .loadNoiseProperties( .get( ));
noiseProperty = (noiseProperties);
;
SUM:
(! .has( )) {
( );
}
(! .has( )) {
( );
}
NoiseProperty[] noiseProperties = .loadNoiseProperties( .get( ));
[] factors = .loadDoubleArray( .get( ), noiseProperties.length);
SumNoiseProperty.Entry[] entries = .Entry[noiseProperties.length];
( ; i < entries.length; ++i) {
entries[i] = .Entry(noiseProperties[i], factors[i]);
}
noiseProperty = (entries);
;
SCALE:
(! .has( )) {
( );
}
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
.get( ).getAsDouble();
noiseProperty = (noise, scale);
;
FORMULA:
(! .has( )) {
( );
}
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
NoiseFormulaProperty. NoiseFormulaProperty.NoiseFormula.valueOf( .get( ).getAsString());
noiseProperty = (noise, noiseFormula.getFormula());
;
MULTIPLY:
(! .has( )) {
( );
}
NoiseProperty[] noiseProperties = .loadNoiseProperties( .get( ));
noiseProperty = (noiseProperties);
;
DISTORTED:
(! .has( )) {
( );
}
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
noiseProperty = (noise, ( ( .seed, .dataFolder, .get( ))).load());
;
NORMALIZE:
(! .has( )) {
( );
}
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
( ( .seed, .dataFolder, .get( ))).load();
noiseProperty = (noise, range.getValue( ), range.getValue( ) - range.getValue( ));
;
INVERT:
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
noiseProperty = (noise);
;
OFFSET:
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
.has( ) ? .get( ).getAsDouble() : ;
.has( ) ? .get( ).getAsDouble() : offset;
.has( ) ? .get( ).getAsDouble() : offset;
.has( ) ? .get( ).getAsDouble() : offset;
noiseProperty = (noise, offsetX, offsetY, offsetZ);
;
ROTATE:
(! .has( )) {
( );
}
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
( ( .seed, .dataFolder, .get( ))).load();
noiseProperty = (noise, rotation);
;
GRADIENT:
(! .has( )) {
( );
}
( ( .seed, .dataFolder, .get( ))).load();
noiseProperty = ( ( .seed, .dataFolder, .json, noise)).load();
;
CURVE:
noiseProperty = ( ( .seed, .dataFolder, .json, (NoiseProperty) )).load();
;
BLEND:
noiseProperty = ( ( .seed, .dataFolder, .json)).load();
;
:
(String.format( , type));
}
} {
.newNoiseFunctionJsonLoader( .seed, .dataFolder, .json).load();
( .has( )) {
FractalNoiseProperty. .has( ) ? FractalNoiseProperty.FractalMode.valueOf( .get( ).getAsString()) : NoisePropertyJsonLoader.Constants.DEFAULT_FRACTAL_MODE;
.get( ).getAsInt();
.has( ) ? .get( ).getAsDouble() : ;
.has( ) ? .get( ).getAsDouble() : ;
noiseProperty = ( .loadSeed(), noiseFunction, fractalMode.getFunction(), octaves, lacunarity, persistence);
} {
noiseProperty = ( .loadSeed(), noiseFunction);
}
}
(type != NoisePropertyType.FORMULA && .has( )) {
NoiseFormulaProperty. NoiseFormulaProperty.NoiseFormula.valueOf( .get( ).getAsString());
noiseProperty = (noiseProperty, noiseFormula.getFormula());
}
(type != NoisePropertyType.CURVE && .has( )) {
noiseProperty = ( ( .seed, .dataFolder, .get( ), noiseProperty)).load();
}
(type != NoisePropertyType.SCALE && .has( )) {
.get( ).getAsDouble();
noiseProperty = (noiseProperty, scale);
}
(type != NoisePropertyType.NORMALIZE && .has( ) && type != NoisePropertyType.GRADIENT) {
( ( .seed, .dataFolder, .get( ))).load();
noiseProperty = (noiseProperty, range.getValue( ), range.getValue( ) - range.getValue( ));
}
(type != NoisePropertyType.OFFSET && ( .has( ) || .has( ) || .has( ) || .has( ))) {
.has( ) ? .get( ).getAsDouble() : ;
.has( ) ? .get( ).getAsDouble() : offset;
.has( ) ? .get( ).getAsDouble() : offset;
.has( ) ? .get( ).getAsDouble() : offset;
noiseProperty = (noiseProperty, offsetX, offsetY, offsetZ);
}
(type != NoisePropertyType.ROTATE && ( .has( ) || .has( ))) {
( ( .seed, .dataFolder, .json)).load();
noiseProperty = (noiseProperty, rotation);
}
(type != NoisePropertyType.GRADIENT && .has( )) {
noiseProperty = ( ( .seed, .dataFolder, .get( ), noiseProperty)).load();
}
noiseProperty;
}
{
.seed.hashCode();
( .has( )) {
SeedString<?> overwritten = .seed.appendToOriginal( .get( ).getAsString());
seedVal = overwritten.hashCode();
.seed.get().reportSeeds(seedVal, .seed.original, .seed.seed, overwritten.seed);
} {
.seed.get().reportSeeds(seedVal, .seed.original, .seed.seed, (String) );
}
seedVal;
}
NoiseProperty[] loadNoiseProperties( JsonElement element) {
(!element.isJsonArray()) {
[ ];
} {
element.getAsJsonArray();
NoiseProperty[] noiseProperties = [array.size()];
( ; i < noiseProperties.length; ++i) {
noiseProperties[i] = ( ( .seed.append(String.format( , i)), .dataFolder, array.get(i))).load();
}
noiseProperties;
}
}
[] loadDoubleArray( JsonElement element, size) {
[] values = [size];
(element != && !element.isJsonNull()) {
(element.isJsonArray()) {
element.getAsJsonArray();
( ; i < size; ++i) {
values[i] = array.get(i).getAsDouble();
}
}
} {
Arrays.fill(values, / ( )size);
}
values;
}
NoiseFunctionJsonLoader {
(seed, dataFolder, json);
}
{
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
FractalNoiseProperty. FractalNoiseProperty.FractalMode.FBM;
;
;
}
}
com/hypixel/hytale/procedurallib/json/NoiseTypeJson.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.NoiseType;
import java.lang.reflect.Constructor;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public enum NoiseTypeJson {
CELL(NoiseType.CELL, CellNoiseJsonLoader.class),
CONSTANT(NoiseType.CONSTANT, ConstantNoiseJsonLoader.class),
DISTANCE(NoiseType.DISTANCE, DistanceNoiseJsonLoader.class),
PERLIN(NoiseType.PERLIN, PerlinNoiseJsonLoader.class),
SIMPLEX(NoiseType.SIMPLEX, SimplexNoiseJsonLoader.class),
OLD_SIMPLEX(NoiseType.OLD_SIMPLEX, OldSimplexNoiseJsonLoader.class),
VALUE(NoiseType.VALUE, ValueNoiseJsonLoader.class),
MESH(NoiseType.MESH, MeshNoiseJsonLoader.class),
GRID(NoiseType.GRID, GridNoiseJsonLoader.class),
BRANCH(NoiseType.BRANCH, BranchNoiseJsonLoader.class),
POINT(NoiseType.POINT, PointNoiseJsonLoader.class);
private final NoiseType noiseType;
@Nonnull
private final Constructor constructor;
private <T extends JsonLoader <?, NoiseFunction>> NoiseTypeJson(NoiseType noiseType, @Nonnull Class<T> loaderClass) {
this .noiseType = noiseType;
try {
this .constructor = loaderClass.getConstructor(SeedString.class, Path.class, JsonElement.class);
this .constructor.setAccessible(true );
} catch (NoSuchMethodException e) {
throw new Error (String.format("Could not find loader constructor for %s. NoiseType: %s" , loaderClass.getName(), noiseType), e);
}
}
<K > JsonLoader<K, NoiseFunction> {
{
(JsonLoader) .constructor.newInstance(seed, dataFolder, json);
} (Exception e) {
(String.format( , .noiseType), e);
}
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/json/OldSimplexNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.OldSimplexNoise;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class OldSimplexNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public OldSimplexNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".OldSimplexNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
return OldSimplexNoise.INSTANCE;
}
}
com/hypixel/hytale/procedurallib/json/PerlinNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import com.hypixel.hytale.procedurallib.logic.PerlinNoise;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class PerlinNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public PerlinNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".PerlinNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
return new PerlinNoise (this .loadInterpolationFunction());
}
protected GeneralNoise.InterpolationFunction loadInterpolationFunction () {
GeneralNoise.InterpolationMode interpolationMode = PerlinNoiseJsonLoader.Constants.DEFAULT_INTERPOLATION_MODE;
if (this .has("InterpolationMode" )) {
interpolationMode = GeneralNoise.InterpolationMode.valueOf(this .get("InterpolationMode" ).getAsString());
}
return interpolationMode.getFunction();
}
{
;
GeneralNoise. GeneralNoise.InterpolationMode.QUINTIC;
}
}
com/hypixel/hytale/procedurallib/json/PointEvaluatorJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.condition.DoubleThresholdCondition;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.IDoubleThreshold;
import com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode;
import com.hypixel.hytale.procedurallib.logic.cell.MeasurementMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.BorderPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.JitterPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.SkipCellPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.DefaultCellJitter;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class PointEvaluatorJsonLoader <T extends SeedResource > extends AbstractCellJitterJsonLoader <T, PointEvaluator> {
@Nonnull
protected final MeasurementMode measurementMode;
protected final PointDistanceFunction pointDistanceFunction;
public PointEvaluatorJsonLoader {
(seed, dataFolder, json, (PointDistanceFunction) );
}
{
(seed, dataFolder, json, MeasurementMode.CENTRE_DISTANCE, pointDistanceFunction);
}
{
(seed.append( ), dataFolder, json);
.measurementMode = measurementMode;
.pointDistanceFunction = pointDistanceFunction;
}
PointEvaluator {
PointEvaluator var10000;
( .measurementMode) {
CENTRE_DISTANCE -> var10000 = .loadCentrePointEvaluator();
BORDER_DISTANCE -> var10000 = .loadBorderPointEvaluator();
-> ((String) , (Throwable) );
}
var10000;
}
PointEvaluator {
PointEvaluator.of( .loadPointDistanceFunction(), .loadDensity(), .loadDistanceRange(), .loadSkipCount(), .loadSkipMode(), .loadJitter());
}
PointEvaluator {
BorderPointEvaluator.INSTANCE;
.loadJitter();
(PointEvaluator)(jitter == DefaultCellJitter.DEFAULT_ONE ? pointEvaluator : (pointEvaluator, jitter));
}
PointDistanceFunction {
( .pointDistanceFunction != ) {
.pointDistanceFunction;
} {
CellNoiseJsonLoader.Constants.DEFAULT_DISTANCE_MODE;
( .has( )) {
distanceCalculationMode = DistanceCalculationMode.valueOf( .get( ).getAsString());
}
distanceCalculationMode.getFunction();
}
}
IDoubleRange {
! .has( ) ? : ( ( .seed, .dataFolder, .get( ))).load();
}
IDoubleCondition {
(! .has( )) {
;
} {
( ( .seed, .dataFolder, .get( ))).load();
(threshold);
}
}
{
.mustGetNumber( , ).intValue();
}
SkipCellPointEvaluator.Mode {
.mustGetString( , SkipCellPointEvaluator.DEFAULT_MODE.name());
SkipCellPointEvaluator.Mode.valueOf(name);
}
}
com/hypixel/hytale/procedurallib/json/PointGeneratorJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.point.DistortedPointGenerator;
import com.hypixel.hytale.procedurallib.logic.point.IPointGenerator;
import com.hypixel.hytale.procedurallib.logic.point.OffsetPointGenerator;
import com.hypixel.hytale.procedurallib.logic.point.PointGenerator;
import com.hypixel.hytale.procedurallib.logic.point.ScaledPointGenerator;
import com.hypixel.hytale.procedurallib.random.CoordinateRotator;
import java.nio.file.Path;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class PointGeneratorJsonLoader <K extends SeedResource > extends JsonLoader <K, IPointGenerator> {
public PointGeneratorJsonLoader (SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed, dataFolder, json);
}
public IPointGenerator load () {
PointGenerator pointGenerator = this .newPointGenerator(this .loadSeed(), this .loadCellDistanceFunction());
pointGenerator;
( .has( )) {
generator = (pointGenerator, .get( ).getAsDouble());
}
( .has( )) {
generator = (generator, ( ( .seed, .dataFolder, .get( ))).load());
}
- / ;
- / ;
- / ;
( .has( )) {
offsetX = offsetY = offsetZ = .get( ).getAsDouble();
}
( .has( )) {
offsetX = .get( ).getAsDouble();
}
( .has( )) {
offsetY = .get( ).getAsDouble();
}
( .has( )) {
offsetZ = .get( ).getAsDouble();
}
(offsetX != - / || offsetY != - / || offsetZ != - / ) {
(offsetX == - / ) {
offsetX = ;
}
(offsetY == - / ) {
offsetY = ;
}
(offsetZ == - / ) {
offsetZ = ;
}
generator = (generator, offsetX, offsetY, offsetZ);
}
( .has( )) {
( ( .seed, .dataFolder, .get( ))).load();
(rotation != CoordinateRotator.NONE) {
generator = (generator, rotation);
}
}
generator;
}
{
.seed.hashCode();
( .has( )) {
SeedString<?> overwritten = .seed.appendToOriginal( .get( ).getAsString());
seedVal = overwritten.hashCode();
.seed.get().reportSeeds(seedVal, .seed.original, .seed.seed, overwritten.seed);
} {
.seed.get().reportSeeds(seedVal, .seed.original, .seed.seed, (String) );
}
seedVal;
}
PointGenerator {
.seed.get();
.loadPointEvaluator();
(seedOffset, cellDistanceFunction, pointEvaluator, seedResource);
}
CellDistanceFunction {
( ( .seed, .dataFolder, .json, .loadPointDistanceFunction())).load();
}
PointEvaluator {
( ( .seed, .dataFolder, .json)).load();
}
PointDistanceFunction {
CellNoiseJsonLoader.Constants.DEFAULT_DISTANCE_MODE;
( .has( )) {
distanceCalculationMode = DistanceCalculationMode.valueOf( .get( ).getAsString());
}
distanceCalculationMode.getFunction();
}
{
;
;
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/PointNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.logic.PointNoise;
import java.nio.file.Path;
import javax.annotation.Nullable;
public class PointNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, PointNoise> {
public PointNoiseJsonLoader (SeedString<K> seed, Path dataFolder, @Nullable JsonElement json) {
super (seed, dataFolder, json);
}
@Nullable
public PointNoise load () {
return new PointNoise (this .mustGetNumber("X" , PointNoiseJsonLoader.Constants.DEFAULT_COORD).doubleValue(), this .mustGetNumber("Y" , PointNoiseJsonLoader.Constants.DEFAULT_COORD).doubleValue(), this .mustGetNumber("Z" , PointNoiseJsonLoader.Constants.DEFAULT_COORD).doubleValue(), this .mustGetNumber("InnerRadius" , PointNoiseJsonLoader.Constants.DEFAULT_RADIUS).doubleValue(), this .mustGetNumber("OuterRadius" , PointNoiseJsonLoader.Constants.DEFAULT_RADIUS).doubleValue());
}
public interface Constants {
String KEY_X = "X" ;
;
;
;
;
;
;
}
}
com/hypixel/hytale/procedurallib/json/SeedResource.java
package com.hypixel.hytale.procedurallib.json;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface SeedResource {
String INFO_SEED_REPORT = "Seed Value: %s for seed %s / %s" ;
String INFO_SEED_OVERWRITE_REPORT = "Seed Value: %s for seed %s / %s overwritten by %s" ;
@Nonnull
default ResultBuffer.Bounds2d localBounds2d () {
return ResultBuffer.bounds2d;
}
@Nonnull
default ResultBuffer.ResultBuffer2d localBuffer2d () {
return ResultBuffer.buffer2d;
}
@Nonnull
default ResultBuffer.ResultBuffer3d localBuffer3d () {
return ResultBuffer.buffer3d;
}
default boolean shouldReportSeeds () {
return false ;
}
default void reportSeeds (int seedVal, String original, String seed, @Nullable String overwritten) {
if (this .shouldReportSeeds()) {
(overwritten == ) {
.writeSeedReport(String.format( , seedVal, original, seed));
} {
.writeSeedReport(String.format( , seedVal, original, seed, overwritten));
}
}
}
{
System.out.println(seedReport);
}
}
com/hypixel/hytale/procedurallib/json/SeedResourcePointGenerator.java
package com.hypixel.hytale.procedurallib.json;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.point.PointGenerator;
import javax.annotation.Nonnull;
public class SeedResourcePointGenerator extends PointGenerator {
private final SeedResource seedResource;
public SeedResourcePointGenerator (int seedOffset, CellDistanceFunction cellDistanceFunction, PointEvaluator pointEvaluator, SeedResource seedResource) {
super (seedOffset, cellDistanceFunction, pointEvaluator);
this .seedResource = seedResource;
}
@Nonnull
protected ResultBuffer.Bounds2d localBounds2d () {
return this .seedResource.localBounds2d();
}
@Nonnull
protected ResultBuffer.ResultBuffer2d localBuffer2d () {
return this .seedResource.localBuffer2d();
}
@Nonnull
protected ResultBuffer.ResultBuffer3d localBuffer3d () {
return this .seedResource.localBuffer3d();
}
}
com/hypixel/hytale/procedurallib/json/SeedString.java
package com.hypixel.hytale.procedurallib.json;
import io.sentry.util.Objects;
import javax.annotation.Nonnull;
public class SeedString <T extends SeedResource > {
public static final SeedResource DEFAULT_RESOURCE = new SeedResource () {
};
@Nonnull
protected final T t;
protected final String original;
protected final String seed;
protected final int hash;
public SeedString (String original, @Nonnull T t) {
this (original, original, t);
}
public SeedString (String original, String seed, @Nonnull T t) {
this .original = original;
this .seed = seed;
this .t = (T)(Objects.requireNonNull(t, "SeedResource must not be null. Use SeedString#DEFAULT" ));
this .hash = this .seed.hashCode() * 114512143 ;
}
@Nonnull
public SeedString<T> append (String suffix) {
<T>( .original, .seed + suffix, .t);
}
SeedString<T> {
<T>( .original, .original + suffix, .t);
}
SeedString<T> {
.original + suffix;
altOriginal + .seed.substring( .original.length());
<T>(altOriginal, altSeed, .t);
}
T {
.t;
}
{
.hash;
}
String {
.seed;
}
}
com/hypixel/hytale/procedurallib/json/SimplexNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.SimplexNoise;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class SimplexNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, NoiseFunction> {
public SimplexNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".SimplexNoise" ), dataFolder, json);
}
@Nonnull
public NoiseFunction load () {
return SimplexNoise.INSTANCE;
}
}
com/hypixel/hytale/procedurallib/json/ValueNoiseJsonLoader.java
package com.hypixel.hytale.procedurallib.json;
import com.google.gson.JsonElement;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import com.hypixel.hytale.procedurallib.logic.ValueNoise;
import java.nio.file.Path;
import javax.annotation.Nonnull;
public class ValueNoiseJsonLoader <K extends SeedResource > extends JsonLoader <K, ValueNoise> {
public ValueNoiseJsonLoader (@Nonnull SeedString<K> seed, Path dataFolder, JsonElement json) {
super (seed.append(".ValueNoise" ), dataFolder, json);
}
@Nonnull
public ValueNoise load () {
return new ValueNoise (this .loadInterpolationFunction());
}
protected GeneralNoise.InterpolationFunction loadInterpolationFunction () {
GeneralNoise.InterpolationMode interpolationMode = ValueNoiseJsonLoader.Constants.DEFAULT_INTERPOLATION_MODE;
if (this .has("InterpolationMode" )) {
interpolationMode = GeneralNoise.InterpolationMode.valueOf(this .get("InterpolationMode" ).getAsString());
}
return interpolationMode.getFunction();
}
public {
;
GeneralNoise. GeneralNoise.InterpolationMode.QUINTIC;
}
}
com/hypixel/hytale/procedurallib/logic/BranchNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.property.NoiseFormulaProperty;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import javax.annotation.Nonnull;
public class BranchNoise implements NoiseFunction {
protected final CellDistanceFunction parentFunction;
protected final PointEvaluator parentEvaluator;
protected final double parentValue;
protected final double emptyValue;
protected final IDoubleRange parentFade;
protected final IIntCondition parentDensity;
protected final DistanceNoise.Distance2Function distance2Function;
protected final NoiseFormulaProperty.NoiseFormula.Formula noiseFormula;
protected final CellDistanceFunction lineFunction;
protected final PointEvaluator lineEvaluator;
protected final double lineScale;
IDoubleRange lineThickness;
{
.parentFunction = parentFunction;
.parentEvaluator = parentEvaluator;
.parentValue = parentValue;
.emptyValue = toOutputRange(parentValue);
.parentFade = parentFade;
.parentDensity = parentDensity;
.distance2Function = distance2Function;
.noiseFormula = noiseFormula;
.lineFunction = lineFunction;
.lineEvaluator = lineEvaluator;
.lineScale = lineScale;
.lineThickness = lineThickness;
}
{
ResultBuffer. .getParentNoise(offsetSeed, x, y);
(! .parentDensity.eval(parent.hash)) {
.emptyValue;
} {
.noiseFormula.eval( .distance2Function.eval(parent.distance, parent.distance2));
.getLineValue(offsetSeed, x, y, parent.hash, parent.x, parent.y, parentDistance, parent);
.parentFade.getValue(parentDistance);
MathUtil.lerp( .parentValue, lineValue, parentFade);
toOutputRange(noiseValue);
}
}
{
();
}
ResultBuffer.ResultBuffer2d {
ResultBuffer.buffer2d;
}
ResultBuffer.ResultBuffer2d {
ResultBuffer. .localBuffer2d();
buffer.distance = / ;
buffer.distance2 = / ;
x = .parentFunction.scale(x);
y = .parentFunction.scale(y);
.parentFunction.getCellX(x, y);
.parentFunction.getCellY(x, y);
.parentFunction.transition2D(seed, x, y, cellX, cellY, buffer, .parentEvaluator);
buffer;
}
{
.lineThickness.getValue(parentDistance);
(thickness == ) {
;
} {
buffer.distance = / ;
buffer.x2 = parentX;
buffer.y2 = parentY;
buffer.ix2 = parentHash;
buffer.distance2 = thickness;
x *= .lineScale;
y *= .lineScale;
x = .lineFunction.scale(x);
y = .lineFunction.scale(y);
.lineFunction.getCellX(x, y);
.lineFunction.getCellY(x, y);
.lineFunction.nearest2D(seed, x, y, cellX, cellY, buffer, .lineEvaluator);
buffer.distance;
distance >= thickness * thickness ? : Math.sqrt(distance) / thickness;
}
}
String {
String.valueOf( .parentFunction);
+ var10000 + + String.valueOf( .parentEvaluator) + + .parentValue + + String.valueOf( .parentFade) + + String.valueOf( .distance2Function) + + String.valueOf( .noiseFormula) + + String.valueOf( .lineFunction) + + String.valueOf( .lineEvaluator) + + .lineScale + + String.valueOf( .lineThickness) + ;
}
{
* value - ;
}
}
com/hypixel/hytale/procedurallib/logic/CellNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class CellNoise implements NoiseFunction {
protected final CellDistanceFunction distanceFunction;
protected final PointEvaluator pointEvaluator;
protected final CellFunction cellFunction;
@Nullable
protected final NoiseProperty noiseLookup;
public CellNoise (CellDistanceFunction distanceFunction, PointEvaluator pointEvaluator, CellFunction cellFunction, @Nullable NoiseProperty noiseLookup) {
this .distanceFunction = distanceFunction;
this .pointEvaluator = pointEvaluator;
this .cellFunction = cellFunction;
this .noiseLookup = noiseLookup;
}
public CellDistanceFunction getDistanceFunction () {
return this .distanceFunction;
}
CellFunction {
.cellFunction;
}
NoiseProperty {
.noiseLookup;
}
{
x = .distanceFunction.scale(x);
y = .distanceFunction.scale(y);
.distanceFunction.getCellX(x, y);
.distanceFunction.getCellY(x, y);
ResultBuffer. .localBuffer2d();
buffer.distance = / ;
.distanceFunction.nearest2D(offsetSeed, x, y, xr, yr, buffer, .pointEvaluator);
GeneralNoise.limit( .cellFunction.eval(seed, offsetSeed, x, y, buffer, .distanceFunction, .noiseLookup)) * - ;
}
{
.distanceFunction.getCellX(x, y, z);
.distanceFunction.getCellY(x, y, z);
.distanceFunction.getCellZ(x, y, z);
ResultBuffer. .localBuffer3d();
buffer.distance = / ;
.distanceFunction.nearest3D(offsetSeed, x, y, z, xr, yr, zr, buffer, .pointEvaluator);
GeneralNoise.limit( .cellFunction.eval(seed, offsetSeed, x, y, z, buffer, .distanceFunction, .noiseLookup)) * - ;
}
ResultBuffer.ResultBuffer2d {
ResultBuffer.buffer2d;
}
ResultBuffer.ResultBuffer3d {
ResultBuffer.buffer3d;
}
String {
String.valueOf( .distanceFunction);
+ var10000 + + String.valueOf( .pointEvaluator) + + String.valueOf( .cellFunction) + + String.valueOf( .noiseLookup) + ;
}
{
CELL_VALUE( () {
{
HashUtil.random(( )offsetSeed, ( )buffer.ix, ( )buffer.iy);
}
{
HashUtil.random(( )offsetSeed, ( )buffer.ix, ( )buffer.iy, ( )buffer.iz);
}
String {
;
}
}),
NOISE_LOOKUP( () {
{
cellFunction.invScale(buffer.x);
cellFunction.invScale(buffer.y);
noiseLookup.get(seed, px, py);
}
{
cellFunction.invScale(buffer.x);
cellFunction.invScale(buffer.y);
cellFunction.invScale(buffer.z);
noiseLookup.get(seed, px, py, pz);
}
String {
;
}
}),
DISTANCE( () {
{
Math.sqrt(buffer.distance);
}
{
Math.sqrt(buffer.distance);
}
String {
;
}
}),
DIRECTION( () {
{
( ) .getAngleNoise(seed, offsetSeed, buffer, noiseLookup) * ;
TrigMathUtil.sin(angle);
TrigMathUtil.cos(angle);
buffer.x;
buffer.y;
ax + ( )dx;
ay + ( )dy;
MathUtil.distanceToInfLineSq(x, y, ax, ay, bx, by);
MathUtil.clamp(Math.sqrt(distance2), , );
MathUtil.sideOfLine(x, y, ax, ay, bx, by);
+ ( )side * distance * ;
}
{
();
}
String {
;
}
{
noiseProperty != ? noiseProperty.get(seed, buffer.x, buffer.y) : HashUtil.random(( )offsetSeed, ( )buffer.ix, ( )buffer.iy);
}
});
CellFunction function;
{
.function = function;
}
CellFunction {
.function;
}
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/logic/CellularNoise.java
package com.hypixel.hytale.procedurallib.logic;
public final class CellularNoise {
public static final DoubleArray.Double2[] CELL_2D = new DoubleArray .Double2[]{new DoubleArray .Double2(0.47180947589876066 , 0.10010325570378009 ), new DoubleArray .Double2(0.6582139851410512 , 0.8262404986000542 ), new DoubleArray .Double2(0.060299854174567735 , 0.21787156789560047 ), new DoubleArray .Double2(0.8808986116722551 , 0.33658412953688055 ), new DoubleArray .Double2(0.3714195695725244 , 0.768120849768431 ), new DoubleArray .Double2(0.09857066064836995 , 0.9939939921911041 ), new DoubleArray .Double2(0.15485458734766344 , 0.3928954542002433 ), new DoubleArray .Double2(0.9922045975726352 , 0.8781419853882811 ), new DoubleArray .Double2(0.008705013059587041 , 0.974686972731753 ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , ), .Double2( , )};
DoubleArray.Double3[] CELL_3D = .Double3[]{ .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3( , , )};
{
();
}
}
com/hypixel/hytale/procedurallib/logic/ConstantNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import javax.annotation.Nonnull;
public class ConstantNoise implements NoiseFunction {
protected final double value;
public ConstantNoise (double value) {
this .value = value;
}
public double getValue () {
return this .value;
}
public double get (int seed, int offsetSeed, double x, double y) {
return this .value;
}
public double get (int seed, int offsetSeed, double x, double y, double z) {
return this .value;
}
@Nonnull
public String toString () {
return "ConstantNoise{value=" + this .value + ;
}
}
com/hypixel/hytale/procedurallib/logic/DistanceNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import javax.annotation.Nonnull;
public abstract class DistanceNoise implements NoiseFunction {
protected final CellDistanceFunction cellDistanceFunction;
protected final PointEvaluator pointEvaluator;
protected final Distance2Function distance2Function;
public DistanceNoise (CellDistanceFunction cellDistanceFunction, PointEvaluator pointEvaluator, Distance2Function distance2Function) {
this .cellDistanceFunction = cellDistanceFunction;
this .pointEvaluator = pointEvaluator;
this .distance2Function = distance2Function;
}
public CellDistanceFunction getCellDistanceFunction () {
return this .cellDistanceFunction;
}
public Distance2Function getDistance2Function () {
return this .distance2Function;
}
public double get (int seed, int offsetSeed, double x, y) {
x = .cellDistanceFunction.scale(x);
y = .cellDistanceFunction.scale(y);
.cellDistanceFunction.getCellX(x, y);
.cellDistanceFunction.getCellY(x, y);
ResultBuffer. .localBuffer2d();
buffer.distance = / ;
buffer.distance2 = / ;
.cellDistanceFunction.transition2D(offsetSeed, x, y, xr, yr, buffer, .pointEvaluator);
buffer.distance = Math.sqrt(buffer.distance);
buffer.distance2 = Math.sqrt(buffer.distance2);
GeneralNoise.limit( .distance2Function.eval(buffer.distance, buffer.distance2)) * - ;
}
{
x = .cellDistanceFunction.scale(x);
y = .cellDistanceFunction.scale(y);
z = .cellDistanceFunction.scale(z);
.cellDistanceFunction.getCellX(x, y, z);
.cellDistanceFunction.getCellY(x, y, z);
.cellDistanceFunction.getCellZ(x, y, z);
ResultBuffer. .localBuffer3d();
buffer.distance = / ;
buffer.distance2 = / ;
.cellDistanceFunction.transition3D(offsetSeed, x, y, z, xr, yr, zr, buffer, .pointEvaluator);
buffer.distance = Math.sqrt(buffer.distance);
buffer.distance2 = Math.sqrt(buffer.distance2);
GeneralNoise.limit( .distance2Function.eval(buffer.distance, buffer.distance2)) * - ;
}
ResultBuffer.ResultBuffer2d ;
ResultBuffer.ResultBuffer3d ;
String {
String.valueOf( .cellDistanceFunction);
+ var10000 + + String.valueOf( .pointEvaluator) + + String.valueOf( .distance2Function) + ;
}
{
ADD( () {
{
distance + distance2;
}
String {
;
}
}),
SUB( () {
{
distance2 - distance;
}
String {
;
}
}),
MUL( () {
{
distance * distance2;
}
String {
;
}
}),
DIV( () {
{
distance / distance2;
}
String {
;
}
}),
MIN( () {
{
distance;
}
String {
;
}
}),
MAX( () {
{
distance2;
}
String {
;
}
});
Distance2Function function;
{
.function = function;
}
Distance2Function {
.function;
}
}
{
;
}
}
com/hypixel/hytale/procedurallib/logic/DoubleArray.java
package com.hypixel.hytale.procedurallib.logic;
import javax.annotation.Nonnull;
public class DoubleArray {
public DoubleArray () {
}
public static class Double2 {
public final double x;
public final double y;
public Double2 (double x, double y) {
this .x = x;
this .y = y;
}
@Nonnull
public String toString () {
return "DoubleArray.Double2{x=" + this .x + ", y=" + this .y + "}" ;
}
}
public static class Double3 {
public final double x;
public final double y;
public final double z;
public Double3 {
.x = x;
.y = y;
.z = z;
}
String {
+ .x + + .y + + .z + ;
}
}
}
com/hypixel/hytale/procedurallib/logic/GeneralNoise.java
package com.hypixel.hytale.procedurallib.logic;
import javax.annotation.Nonnull;
public final class GeneralNoise {
public static final int X_PRIME = 1619 ;
public static final int Y_PRIME = 31337 ;
public static final int Z_PRIME = 6971 ;
private static final DoubleArray.Double2[] GRAD_2D = new DoubleArray .Double2[]{new DoubleArray .Double2(-1.0 , -1.0 ), new DoubleArray .Double2(1.0 , -1.0 ), new DoubleArray .Double2(-1.0 , 1.0 ), new DoubleArray .Double2(1.0 , 1.0 ), new DoubleArray .Double2(0.0 , -1.0 ), .Double2(- , ), .Double2( , ), .Double2( , )};
DoubleArray.Double3[] GRAD_3D = .Double3[]{ .Double3( , , ), .Double3(- , , ), .Double3( , - , ), .Double3(- , - , ), .Double3( , , ), .Double3(- , , ), .Double3( , , - ), .Double3(- , , - ), .Double3( , , ), .Double3( , - , ), .Double3( , , - ), .Double3( , - , - ), .Double3( , , ), .Double3( , - , ), .Double3(- , , ), .Double3( , - , - )};
{
();
}
{
f >= ? ( )f : ( )f - ;
}
{
f >= ? ( )f + : ( )f;
}
{
a + t * (b - a);
}
{
seed ^ * x;
hash ^= * y;
hash = hash * hash * hash * ;
hash = hash >> ^ hash;
hash;
}
{
seed ^ * x;
hash ^= * y;
hash ^= * z;
hash = hash * hash * hash * ;
hash = hash >> ^ hash;
hash;
}
{
hash2D(seed, x, y);
DoubleArray. GRAD_2D[hash & ];
xd * g.x + yd * g.y;
}
{
hash3D(seed, x, y, z);
DoubleArray. GRAD_3D[hash & ];
xd * g.x + yd * g.y + zd * g.z;
}
{
(val < ) {
;
} {
val > ? : val;
}
}
{
LINEAR( () {
{
t;
}
String {
;
}
}),
HERMITE( () {
{
t * t * ( - * t);
}
String {
;
}
}),
QUINTIC( () {
{
t * t * t * (t * (t * - ) + );
}
String {
;
}
});
InterpolationFunction function;
{
.function = function;
}
InterpolationFunction {
.function;
}
}
{
;
}
}
com/hypixel/hytale/procedurallib/logic/GridNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import javax.annotation.Nonnull;
public class GridNoise implements NoiseFunction {
protected final double thicknessX;
protected final double thicknessY;
protected final double thicknessZ;
protected final double thicknessX_m1;
protected final double thicknessY_m1;
protected final double thicknessZ_m1;
public GridNoise (double thicknessX, double thicknessY, double thicknessZ) {
this .thicknessX = thicknessX;
this .thicknessY = thicknessY;
this .thicknessZ = thicknessZ;
this .thicknessX_m1 = 1.0 - thicknessX;
this .thicknessY_m1 = 1.0 - thicknessY;
this .thicknessZ_m1 = 1.0 - thicknessZ;
}
public double get ( seed, offsetSeed, x, y) {
x -= ( )MathUtil.floor(x);
y -= ( )MathUtil.floor(y);
;
(x < .thicknessX) {
d = x / .thicknessX;
} (x > .thicknessX_m1) {
d = ( - x) / .thicknessX;
}
(y < .thicknessY) {
y / .thicknessY;
(t < d) {
d = t;
}
} (y > .thicknessY_m1) {
( - y) / .thicknessY;
(t < d) {
d = t;
}
}
d * - ;
}
{
x -= ( )MathUtil.floor(x);
y -= ( )MathUtil.floor(y);
z -= ( )MathUtil.floor(z);
;
(x < .thicknessX) {
d = x / .thicknessX;
} (x > .thicknessX_m1) {
d = ( - x) / .thicknessX;
}
(y < .thicknessY) {
y / .thicknessY;
(t < d) {
d = t;
}
} (y > .thicknessY_m1) {
( - y) / .thicknessY;
(t < d) {
d = t;
}
}
(z < .thicknessZ) {
z / .thicknessZ;
(t < d) {
d = t;
}
} (z > .thicknessZ_m1) {
( - z) / .thicknessZ;
(t < d) {
d = t;
}
}
d * - ;
}
String {
+ .thicknessX + + .thicknessY + + .thicknessZ + ;
}
}
com/hypixel/hytale/procedurallib/logic/HexMeshNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.cell.HexCellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
public class HexMeshNoise implements NoiseFunction {
protected final IIntCondition density;
protected final double thickness;
protected final double thicknessSquared;
protected final CellJitter jitter;
protected final boolean linesX;
protected final boolean linesY;
protected final boolean linesZ;
public HexMeshNoise (IIntCondition density, double thickness, CellJitter jitter, boolean linesX, boolean linesY, boolean linesZ) {
double domainLocalThickness = HexCellDistanceFunction.DISTANCE_FUNCTION.scale(thickness);
this .density = density;
this .thickness = domainLocalThickness;
.thicknessSquared = domainLocalThickness * domainLocalThickness;
.jitter = jitter;
.linesX = linesX;
.linesY = linesY;
.linesZ = linesZ;
}
{
x = HexCellDistanceFunction.DISTANCE_FUNCTION.scale(x);
y = HexCellDistanceFunction.DISTANCE_FUNCTION.scale(y);
HexCellDistanceFunction.toGridX(x, y);
HexCellDistanceFunction.toGridY(x, y);
.thicknessSquared;
nearest = .checkConnections(offsetSeed, x, y, cx - , cy - , nearest);
nearest = .checkConnections(offsetSeed, x, y, cx - , cy + , nearest);
nearest = .checkConnections(offsetSeed, x, y, cx + , cy + , nearest);
nearest = .checkConnections(offsetSeed, x, y, cx + , cy - , nearest);
nearest = .checkConnections(offsetSeed, x, y, cx + , cy + , nearest);
( .linesZ) {
nearest = .checkDiagonalConnections(offsetSeed, x, y, cx + , cy + , nearest);
nearest = .checkDiagonalConnections(offsetSeed, x, y, cx + , cy - , nearest);
nearest = .checkDiagonalConnections(offsetSeed, x, y, cx + , cy + , nearest);
nearest = .checkDiagonalConnections(offsetSeed, x, y, cx - , cy + , nearest);
nearest = .checkDiagonalConnections(offsetSeed, x, y, cx - , cy - , nearest);
}
(nearest < .thicknessSquared) {
Math.sqrt(nearest);
distance / .thickness;
d * - ;
} {
;
}
}
{
( );
}
{
HexCellDistanceFunction.getHash(offsetSeed, cx, cy);
(! .density.eval(hash)) {
nearest;
} {
DoubleArray. HexCellDistanceFunction.HEX_CELL_2D[hash & ];
.jitter.getPointX(cx, vec);
.jitter.getPointY(cy, vec);
HexCellDistanceFunction.toHexX(px, py);
HexCellDistanceFunction.toHexY(px, py);
x - ax;
y - ay;
( .linesX) {
nearest = Math.min(nearest, .dist2Cell(offsetSeed, x, y, adx, ady, ax, ay, cx - , cy));
nearest = Math.min(nearest, .dist2Cell(offsetSeed, x, y, adx, ady, ax, ay, cx + , cy));
}
( .linesY) {
nearest = Math.min(nearest, .dist2Cell(offsetSeed, x, y, adx, ady, ax, ay, cx, cy - ));
nearest = Math.min(nearest, .dist2Cell(offsetSeed, x, y, adx, ady, ax, ay, cx, cy + ));
}
nearest;
}
}
{
HexCellDistanceFunction.getHash(offsetSeed, cx, cy);
(! .density.eval(hash)) {
nearest;
} {
DoubleArray. HexCellDistanceFunction.HEX_CELL_2D[hash & ];
.jitter.getPointX(cx, vec);
.jitter.getPointY(cy, vec);
HexCellDistanceFunction.toHexX(px, py);
HexCellDistanceFunction.toHexY(px, py);
x - ax;
y - ay;
nearest = Math.min(nearest, .dist2Cell(offsetSeed, x, y, adx, ady, ax, ay, cx - , cy + ));
nearest = Math.min(nearest, .dist2Cell(offsetSeed, x, y, adx, ady, ax, ay, cx + , cy - ));
nearest;
}
}
{
HexCellDistanceFunction.getHash(offsetSeed, cx, cy);
(! .density.eval(hash)) {
;
} {
DoubleArray. HexCellDistanceFunction.HEX_CELL_2D[hash & ];
.jitter.getPointX(cx, vec);
.jitter.getPointY(cy, vec);
HexCellDistanceFunction.toHexX(px, py);
HexCellDistanceFunction.toHexY(px, py);
MathUtil.distanceToLineSq(x, y, ax, ay, bx, by, adx, ady, bx - ax, by - ay);
}
}
}
com/hypixel/hytale/procedurallib/logic/MeshNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.vector.Vector2i;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.cell.GridCellDistanceFunction;
public class MeshNoise implements NoiseFunction {
public static final Vector2i[] ADJACENT_CELLS = new Vector2i []{new Vector2i (-1 , 0 ), new Vector2i (0 , -1 ), new Vector2i (1 , 0 ), new Vector2i (0 , 1 )};
private final IIntCondition density;
private final double thickness;
private final double thicknessSquared;
private final double jitterX;
private final double jitterY;
public MeshNoise (IIntCondition density, thickness, jitterX, jitterY) {
.density = density;
.thickness = thickness;
.thicknessSquared = thickness * thickness;
.jitterX = jitterX;
.jitterY = jitterY;
}
{
.thickness;
.thicknessSquared;
GeneralNoise.fastFloor(x);
GeneralNoise.fastFloor(y);
x - ( )_x;
y - ( )_y;
( ; c < ; ++c) {
(c) {
:
(rx >= thickness || ry >= thickness) {
;
}
;
:
(rx >= thickness) {
;
}
;
:
(rx >= thickness || ry < - thickness) {
;
}
;
:
(ry >= thickness) {
;
}
:
:
;
:
(ry < - thickness) {
;
}
;
:
(rx < - thickness || ry >= thickness) {
;
}
;
:
(rx < - thickness) {
;
}
}
c / ;
c % ;
_x + cx - ;
_y + cy - ;
GridCellDistanceFunction.getHash(offsetSeed, xr, yr);
( .density.eval(cellHash)) {
DoubleArray. CellularNoise.CELL_2D[cellHash & ];
cell.x * .jitterX;
cell.y * .jitterY;
( )xr + cellX;
( )yr + cellY;
x - centerX;
y - centerY;
(Vector2i v : ADJACENT_CELLS) {
xr + v.x;
yr + v.y;
GridCellDistanceFunction.getHash(offsetSeed, xi, yi);
( .density.eval(vecHash)) {
DoubleArray. CellularNoise.CELL_2D[vecHash & ];
vec.x * .jitterX;
vec.y * .jitterY;
( )v.x + vecX - cellX;
( )v.y + vecY - cellY;
(qX * vx + qY * vy) / (vx * vx + vy * vy);
(t < ) {
t = ;
} (t > ) {
t = ;
}
centerX + vx * t;
centerY + vy * t;
x - lx;
y - ly;
dx * dx + dy * dy;
(distance < lowest) {
lowest = distance;
}
}
}
}
}
(lowest != .thicknessSquared) {
Math.sqrt(lowest);
distance / thickness;
d * - ;
} {
;
}
}
{
( );
}
}
com/hypixel/hytale/procedurallib/logic/OldSimplexNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import javax.annotation.Nonnull;
public class OldSimplexNoise implements NoiseFunction {
public static final OldSimplexNoise INSTANCE = new OldSimplexNoise ();
private static final double STRETCH_CONSTANT_2D = -0.211324865405187 ;
private static final double SQUISH_CONSTANT_2D = 0.366025403784439 ;
private static final double STRETCH_CONSTANT_3D = -0.16666666666666666 ;
private static final double SQUISH_CONSTANT_3D = 0.3333333333333333 ;
private static final double NORM_CONSTANT_2D = ;
;
DoubleArray.Double2[] gradients2D = .Double2[]{ .Double2( , ), .Double2( , ), .Double2(- , ), .Double2(- , ), .Double2( , - ), .Double2( , - ), .Double2(- , - ), .Double2(- , - )};
DoubleArray.Double3[] gradients3D = .Double3[]{ .Double3(- , , ), .Double3(- , , ), .Double3(- , , ), .Double3( , , ), .Double3( , , ), .Double3( , , ), .Double3(- , - , ), .Double3(- , - , ), .Double3(- , - , ), .Double3( , - , ), .Double3( , - , ), .Double3( , - , ), .Double3(- , , - ), .Double3(- , , - ), .Double3(- , , - ), .Double3( , , - ), .Double3( , , - ), .Double3( , , - ), .Double3(- , - , - ), .Double3(- , - , - ), .Double3(- , - , - ), .Double3( , - , - ), .Double3( , - , - ), .Double3( , - , - )};
{
}
{
(x + y) * - ;
x + stretchOffset;
y + stretchOffset;
fastFloor(xs);
fastFloor(ys);
( )(xsb + ysb) * ;
( )xsb + squishOffset;
( )ysb + squishOffset;
xs - ( )xsb;
ys - ( )ysb;
xins + yins;
x - xb;
y - yb;
;
dx0 - - ;
dy0 - - ;
- dx1 * dx1 - dy1 * dy1;
(attn1 > ) {
attn1 *= attn1;
value += attn1 * attn1 * extrapolate(offsetSeed, xsb + , ysb + , dx1, dy1);
}
dx0 - - ;
dy0 - - ;
- dx2 * dx2 - dy2 * dy2;
(attn2 > ) {
attn2 *= attn2;
value += attn2 * attn2 * extrapolate(offsetSeed, xsb + , ysb + , dx2, dy2);
}
dx_ext;
dy_ext;
xsv_ext;
ysv_ext;
(inSum <= ) {
- inSum;
(!(zins > xins) && !(zins > yins)) {
xsv_ext = xsb + ;
ysv_ext = ysb + ;
dx_ext = dx0 - - ;
dy_ext = dy0 - - ;
} (xins > yins) {
xsv_ext = xsb + ;
ysv_ext = ysb - ;
dx_ext = dx0 - ;
dy_ext = dy0 + ;
} {
xsv_ext = xsb - ;
ysv_ext = ysb + ;
dx_ext = dx0 + ;
dy_ext = dy0 - ;
}
} {
- inSum;
(!(zins < xins) && !(zins < yins)) {
dx_ext = dx0;
dy_ext = dy0;
xsv_ext = xsb;
ysv_ext = ysb;
} (xins > yins) {
xsv_ext = xsb + ;
ysv_ext = ysb + ;
dx_ext = dx0 - - ;
dy_ext = dy0 + - ;
} {
xsv_ext = xsb + ;
ysv_ext = ysb + ;
dx_ext = dx0 + - ;
dy_ext = dy0 - - ;
}
++xsb;
++ysb;
dx0 = dx0 - - ;
dy0 = dy0 - - ;
}
- dx0 * dx0 - dy0 * dy0;
(attn0 > ) {
attn0 *= attn0;
value += attn0 * attn0 * extrapolate(offsetSeed, xsb, ysb, dx0, dy0);
}
- dx_ext * dx_ext - dy_ext * dy_ext;
(attn_ext > ) {
attn_ext *= attn_ext;
value += attn_ext * attn_ext * extrapolate(offsetSeed, xsv_ext, ysv_ext, dx_ext, dy_ext);
}
value / ;
}
{
(x + y + z) * - ;
x + stretchOffset;
y + stretchOffset;
z + stretchOffset;
fastFloor(xs);
fastFloor(ys);
fastFloor(zs);
( )(xsb + ysb + zsb) * ;
( )xsb + squishOffset;
( )ysb + squishOffset;
( )zsb + squishOffset;
xs - ( )xsb;
ys - ( )ysb;
zs - ( )zsb;
xins + yins + zins;
x - xb;
y - yb;
z - zb;
;
dx_ext0;
dy_ext0;
dz_ext0;
dx_ext1;
dy_ext1;
dz_ext1;
xsv_ext0;
ysv_ext0;
zsv_ext0;
xsv_ext1;
ysv_ext1;
zsv_ext1;
(inSum <= ) {
;
xins;
;
yins;
(xins >= yins && zins > yins) {
bScore = zins;
bPoint = ;
} (xins < yins && zins > xins) {
aScore = zins;
aPoint = ;
}
- inSum;
(!(wins > aScore) && !(wins > bScore)) {
( )(aPoint | bPoint);
((c & ) == ) {
xsv_ext0 = xsb;
xsv_ext1 = xsb - ;
dx_ext0 = dx0 - ;
dx_ext1 = dx0 + - ;
} {
xsv_ext0 = xsv_ext1 = xsb + ;
dx_ext0 = dx0 - - ;
dx_ext1 = dx0 - - ;
}
((c & ) == ) {
ysv_ext0 = ysb;
ysv_ext1 = ysb - ;
dy_ext0 = dy0 - ;
dy_ext1 = dy0 + - ;
} {
ysv_ext0 = ysv_ext1 = ysb + ;
dy_ext0 = dy0 - - ;
dy_ext1 = dy0 - - ;
}
((c & ) == ) {
zsv_ext0 = zsb;
zsv_ext1 = zsb - ;
dz_ext0 = dz0 - ;
dz_ext1 = dz0 + - ;
} {
zsv_ext0 = zsv_ext1 = zsb + ;
dz_ext0 = dz0 - - ;
dz_ext1 = dz0 - - ;
}
} {
bScore > aScore ? bPoint : aPoint;
((c & ) == ) {
xsv_ext0 = xsb - ;
xsv_ext1 = xsb;
dx_ext0 = dx0 + ;
dx_ext1 = dx0;
} {
xsv_ext0 = xsv_ext1 = xsb + ;
dx_ext0 = dx_ext1 = dx0 - ;
}
((c & ) == ) {
ysv_ext1 = ysb;
ysv_ext0 = ysb;
dy_ext1 = dy0;
dy_ext0 = dy0;
((c & ) == ) {
ysv_ext1 = ysb - ;
dy_ext1 = dy0 + ;
} {
ysv_ext0 = ysb - ;
dy_ext0 = dy0 + ;
}
} {
ysv_ext0 = ysv_ext1 = ysb + ;
dy_ext0 = dy_ext1 = dy0 - ;
}
((c & ) == ) {
zsv_ext0 = zsb;
zsv_ext1 = zsb - ;
dz_ext0 = dz0;
dz_ext1 = dz0 + ;
} {
zsv_ext0 = zsv_ext1 = zsb + ;
dz_ext0 = dz_ext1 = dz0 - ;
}
}
- dx0 * dx0 - dy0 * dy0 - dz0 * dz0;
(attn0 > ) {
attn0 *= attn0;
value += attn0 * attn0 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx0, dy0, dz0);
}
dx0 - - ;
dy0 - - ;
dz0 - - ;
- dx1 * dx1 - dy1 * dy1 - dz1 * dz1;
(attn1 > ) {
attn1 *= attn1;
value += attn1 * attn1 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx1, dy1, dz1);
}
dx0 - - ;
dy0 - - ;
- dx2 * dx2 - dy2 * dy2 - dz1 * dz1;
(attn2 > ) {
attn2 *= attn2;
value += attn2 * attn2 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx2, dy2, dz1);
}
dz0 - - ;
- dx2 * dx2 - dy1 * dy1 - dz3 * dz3;
(attn3 > ) {
attn3 *= attn3;
value += attn3 * attn3 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx2, dy1, dz3);
}
} (inSum >= ) {
;
xins;
;
yins;
(xins <= yins && zins < yins) {
bScore = zins;
bPoint = ;
} (xins > yins && zins < xins) {
aScore = zins;
aPoint = ;
}
- inSum;
(!(wins < aScore) && !(wins < bScore)) {
( )(aPoint & bPoint);
((c & ) != ) {
xsv_ext0 = xsb + ;
xsv_ext1 = xsb + ;
dx_ext0 = dx0 - - ;
dx_ext1 = dx0 - - ;
} {
xsv_ext1 = xsb;
xsv_ext0 = xsb;
dx_ext0 = dx0 - ;
dx_ext1 = dx0 - ;
}
((c & ) != ) {
ysv_ext0 = ysb + ;
ysv_ext1 = ysb + ;
dy_ext0 = dy0 - - ;
dy_ext1 = dy0 - - ;
} {
ysv_ext1 = ysb;
ysv_ext0 = ysb;
dy_ext0 = dy0 - ;
dy_ext1 = dy0 - ;
}
((c & ) != ) {
zsv_ext0 = zsb + ;
zsv_ext1 = zsb + ;
dz_ext0 = dz0 - - ;
dz_ext1 = dz0 - - ;
} {
zsv_ext1 = zsb;
zsv_ext0 = zsb;
dz_ext0 = dz0 - ;
dz_ext1 = dz0 - ;
}
} {
bScore < aScore ? bPoint : aPoint;
((c & ) != ) {
xsv_ext0 = xsb + ;
xsv_ext1 = xsb + ;
dx_ext0 = dx0 - - ;
dx_ext1 = dx0 - - ;
} {
xsv_ext1 = xsb;
xsv_ext0 = xsb;
dx_ext0 = dx_ext1 = dx0 - ;
}
((c & ) != ) {
ysv_ext0 = ysv_ext1 = ysb + ;
dy_ext0 = dy_ext1 = dy0 - - ;
((c & ) != ) {
++ysv_ext1;
--dy_ext1;
} {
++ysv_ext0;
--dy_ext0;
}
} {
ysv_ext1 = ysb;
ysv_ext0 = ysb;
dy_ext0 = dy_ext1 = dy0 - ;
}
((c & ) != ) {
zsv_ext0 = zsb + ;
zsv_ext1 = zsb + ;
dz_ext0 = dz0 - - ;
dz_ext1 = dz0 - - ;
} {
zsv_ext1 = zsb;
zsv_ext0 = zsb;
dz_ext0 = dz_ext1 = dz0 - ;
}
}
dx0 - - ;
dy0 - - ;
dz0 - - ;
- dx3 * dx3 - dy3 * dy3 - dz3 * dz3;
(attn3 > ) {
attn3 *= attn3;
value += attn3 * attn3 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx3, dy3, dz3);
}
dy0 - - ;
dz0 - - ;
- dx3 * dx3 - dy2 * dy2 - dz2 * dz2;
(attn2 > ) {
attn2 *= attn2;
value += attn2 * attn2 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx3, dy2, dz2);
}
dx0 - - ;
- dx1 * dx1 - dy3 * dy3 - dz2 * dz2;
(attn1 > ) {
attn1 *= attn1;
value += attn1 * attn1 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx1, dy3, dz2);
}
dx0 = dx0 - - ;
dy0 = dy0 - - ;
dz0 = dz0 - - ;
- dx0 * dx0 - dy0 * dy0 - dz0 * dz0;
(attn0 > ) {
attn0 *= attn0;
value += attn0 * attn0 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx0, dy0, dz0);
}
} {
xins + yins;
aPoint;
aScore;
aIsFurtherSide;
(p1 > ) {
aScore = p1 - ;
aPoint = ;
aIsFurtherSide = ;
} {
aScore = - p1;
aPoint = ;
aIsFurtherSide = ;
}
xins + zins;
bIsFurtherSide;
bScore;
bPoint;
(p2 > ) {
bScore = p2 - ;
bPoint = ;
bIsFurtherSide = ;
} {
bScore = - p2;
bPoint = ;
bIsFurtherSide = ;
}
yins + zins;
(p3 > ) {
p3 - ;
(aScore <= bScore && aScore < score) {
aPoint = ;
aIsFurtherSide = ;
} (aScore > bScore && bScore < score) {
bPoint = ;
bIsFurtherSide = ;
}
} {
- p3;
(aScore <= bScore && aScore < score) {
aPoint = ;
aIsFurtherSide = ;
} (aScore > bScore && bScore < score) {
bPoint = ;
bIsFurtherSide = ;
}
}
(aIsFurtherSide == bIsFurtherSide) {
(aIsFurtherSide) {
dx_ext0 = dx0 - - ;
dy_ext0 = dy0 - - ;
dz_ext0 = dz0 - - ;
xsv_ext0 = xsb + ;
ysv_ext0 = ysb + ;
zsv_ext0 = zsb + ;
( )(aPoint & bPoint);
((c & ) != ) {
dx_ext1 = dx0 - - ;
dy_ext1 = dy0 - ;
dz_ext1 = dz0 - ;
xsv_ext1 = xsb + ;
ysv_ext1 = ysb;
zsv_ext1 = zsb;
} ((c & ) != ) {
dx_ext1 = dx0 - ;
dy_ext1 = dy0 - - ;
dz_ext1 = dz0 - ;
xsv_ext1 = xsb;
ysv_ext1 = ysb + ;
zsv_ext1 = zsb;
} {
dx_ext1 = dx0 - ;
dy_ext1 = dy0 - ;
dz_ext1 = dz0 - - ;
xsv_ext1 = xsb;
ysv_ext1 = ysb;
zsv_ext1 = zsb + ;
}
} {
dx_ext0 = dx0;
dy_ext0 = dy0;
dz_ext0 = dz0;
xsv_ext0 = xsb;
ysv_ext0 = ysb;
zsv_ext0 = zsb;
( )(aPoint | bPoint);
((c & ) == ) {
dx_ext1 = dx0 + - ;
dy_ext1 = dy0 - - ;
dz_ext1 = dz0 - - ;
xsv_ext1 = xsb - ;
ysv_ext1 = ysb + ;
zsv_ext1 = zsb + ;
} ((c & ) == ) {
dx_ext1 = dx0 - - ;
dy_ext1 = dy0 + - ;
dz_ext1 = dz0 - - ;
xsv_ext1 = xsb + ;
ysv_ext1 = ysb - ;
zsv_ext1 = zsb + ;
} {
dx_ext1 = dx0 - - ;
dy_ext1 = dy0 - - ;
dz_ext1 = dz0 + - ;
xsv_ext1 = xsb + ;
ysv_ext1 = ysb + ;
zsv_ext1 = zsb - ;
}
}
} {
c2;
c1;
(aIsFurtherSide) {
c1 = aPoint;
c2 = bPoint;
} {
c1 = bPoint;
c2 = aPoint;
}
((c1 & ) == ) {
dx_ext0 = dx0 + - ;
dy_ext0 = dy0 - - ;
dz_ext0 = dz0 - - ;
xsv_ext0 = xsb - ;
ysv_ext0 = ysb + ;
zsv_ext0 = zsb + ;
} ((c1 & ) == ) {
dx_ext0 = dx0 - - ;
dy_ext0 = dy0 + - ;
dz_ext0 = dz0 - - ;
xsv_ext0 = xsb + ;
ysv_ext0 = ysb - ;
zsv_ext0 = zsb + ;
} {
dx_ext0 = dx0 - - ;
dy_ext0 = dy0 - - ;
dz_ext0 = dz0 + - ;
xsv_ext0 = xsb + ;
ysv_ext0 = ysb + ;
zsv_ext0 = zsb - ;
}
dx_ext1 = dx0 - ;
dy_ext1 = dy0 - ;
dz_ext1 = dz0 - ;
xsv_ext1 = xsb;
ysv_ext1 = ysb;
zsv_ext1 = zsb;
((c2 & ) != ) {
dx_ext1 -= ;
xsv_ext1 = xsb + ;
} ((c2 & ) != ) {
dy_ext1 -= ;
ysv_ext1 = ysb + ;
} {
dz_ext1 -= ;
zsv_ext1 = zsb + ;
}
}
dx0 - - ;
dy0 - - ;
dz0 - - ;
- dx1 * dx1 - dy1 * dy1 - dz1 * dz1;
(attn1 > ) {
attn1 *= attn1;
value += attn1 * attn1 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx1, dy1, dz1);
}
dx0 - - ;
dy0 - - ;
- dx2 * dx2 - dy2 * dy2 - dz1 * dz1;
(attn2 > ) {
attn2 *= attn2;
value += attn2 * attn2 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx2, dy2, dz1);
}
dz0 - - ;
- dx2 * dx2 - dy1 * dy1 - dz3 * dz3;
(attn3 > ) {
attn3 *= attn3;
value += attn3 * attn3 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx2, dy1, dz3);
}
dx0 - - ;
dy0 - - ;
dz0 - - ;
- dx4 * dx4 - dy4 * dy4 - dz4 * dz4;
(attn4 > ) {
attn4 *= attn4;
value += attn4 * attn4 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx4, dy4, dz4);
}
dy0 - - ;
dz0 - - ;
- dx4 * dx4 - dy5 * dy5 - dz5 * dz5;
(attn5 > ) {
attn5 *= attn5;
value += attn5 * attn5 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx4, dy5, dz5);
}
dx0 - - ;
- dx6 * dx6 - dy4 * dy4 - dz5 * dz5;
(attn6 > ) {
attn6 *= attn6;
value += attn6 * attn6 * extrapolate(offsetSeed, xsb + , ysb + , zsb + , dx6, dy4, dz5);
}
}
- dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0;
(attn_ext0 > ) {
attn_ext0 *= attn_ext0;
value += attn_ext0 * attn_ext0 * extrapolate(offsetSeed, xsv_ext0, ysv_ext0, zsv_ext0, dx_ext0, dy_ext0, dz_ext0);
}
- dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1;
(attn_ext1 > ) {
attn_ext1 *= attn_ext1;
value += attn_ext1 * attn_ext1 * extrapolate(offsetSeed, xsv_ext1, ysv_ext1, zsv_ext1, dx_ext1, dy_ext1, dz_ext1);
}
value / ;
}
String {
;
}
{
seed ^ * x;
hash ^= * y;
hash = hash * hash * hash * ;
hash = hash >> ^ hash;
DoubleArray. gradients2D[hash & ];
xd * g.x + yd * g.y;
}
{
seed ^ * x;
hash ^= * y;
hash ^= * z;
hash = hash * hash * hash * ;
hash = hash >> ^ hash;
DoubleArray. gradients3D[hash % gradients3D.length];
xd * g.x + yd * g.y + zd * g.z;
}
{
( )x;
x < ( )xi ? xi - : xi;
}
}
com/hypixel/hytale/procedurallib/logic/PerlinNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import javax.annotation.Nonnull;
public class PerlinNoise implements NoiseFunction {
protected final GeneralNoise.InterpolationFunction interpolationFunction;
public PerlinNoise (GeneralNoise.InterpolationFunction interpolationFunction) {
this .interpolationFunction = interpolationFunction;
}
public GeneralNoise.InterpolationFunction getInterpolationFunction () {
return this .interpolationFunction;
}
public double get (int seed, int offsetSeed, double x, double y) {
int x0 = GeneralNoise.fastFloor(x);
int y0 = GeneralNoise.fastFloor(y);
int x1 = x0 + 1 ;
int y1 = y0 + 1 ;
double xs = this .interpolationFunction.interpolate(x - (double )x0);
.interpolationFunction.interpolate(y - ( )y0);
x - ( )x0;
y - ( )y0;
xd0 - ;
yd0 - ;
GeneralNoise.lerp(GeneralNoise.gradCoord2D(offsetSeed, x0, y0, xd0, yd0), GeneralNoise.gradCoord2D(offsetSeed, x1, y0, xd1, yd0), xs);
GeneralNoise.lerp(GeneralNoise.gradCoord2D(offsetSeed, x0, y1, xd0, yd1), GeneralNoise.gradCoord2D(offsetSeed, x1, y1, xd1, yd1), xs);
GeneralNoise.lerp(xf0, xf1, ys);
}
{
GeneralNoise.fastFloor(x);
GeneralNoise.fastFloor(y);
GeneralNoise.fastFloor(z);
x0 + ;
y0 + ;
z0 + ;
.interpolationFunction.interpolate(x - ( )x0);
.interpolationFunction.interpolate(y - ( )y0);
.interpolationFunction.interpolate(z - ( )z0);
x - ( )x0;
y - ( )y0;
z - ( )z0;
xd0 - ;
yd0 - ;
zd0 - ;
GeneralNoise.lerp(GeneralNoise.gradCoord3D(offsetSeed, x0, y0, z0, xd0, yd0, zd0), GeneralNoise.gradCoord3D(offsetSeed, x1, y0, z0, xd1, yd0, zd0), xs);
GeneralNoise.lerp(GeneralNoise.gradCoord3D(offsetSeed, x0, y1, z0, xd0, yd1, zd0), GeneralNoise.gradCoord3D(offsetSeed, x1, y1, z0, xd1, yd1, zd0), xs);
GeneralNoise.lerp(GeneralNoise.gradCoord3D(offsetSeed, x0, y0, z1, xd0, yd0, zd1), GeneralNoise.gradCoord3D(offsetSeed, x1, y0, z1, xd1, yd0, zd1), xs);
GeneralNoise.lerp(GeneralNoise.gradCoord3D(offsetSeed, x0, y1, z1, xd0, yd1, zd1), GeneralNoise.gradCoord3D(offsetSeed, x1, y1, z1, xd1, yd1, zd1), xs);
GeneralNoise.lerp(xf00, xf10, ys);
GeneralNoise.lerp(xf01, xf11, ys);
GeneralNoise.lerp(yf0, yf1, zs);
}
String {
+ String.valueOf( .interpolationFunction) + ;
}
}
com/hypixel/hytale/procedurallib/logic/PointNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.NoiseFunction;
public class PointNoise implements NoiseFunction {
private final double x;
private final double y;
private final double z;
private final double innerRadius2;
private final double outerRadius2;
private final transient double invRange2;
public PointNoise (double x, double y, double z, double innerRadius, double outerRadius) {
this .x = x;
this .y = y;
this .z = z;
this .innerRadius2 = innerRadius * innerRadius;
this .outerRadius2 = outerRadius * outerRadius;
double range = this .outerRadius2 - this .innerRadius2;
this .invRange2 = range == 0.0 ? : / range;
}
{
MathUtil.lengthSquared(x - .x, y - .y);
(dist2 <= .innerRadius2) {
- ;
} {
dist2 >= .outerRadius2 ? : - + * (dist2 - .innerRadius2) * .invRange2;
}
}
{
MathUtil.lengthSquared(x - .x, y - .y, .z - z);
(dist2 <= .innerRadius2) {
- ;
} {
dist2 >= .outerRadius2 ? : - + * (dist2 - .innerRadius2) * .invRange2;
}
}
}
com/hypixel/hytale/procedurallib/logic/ResultBuffer.java
package com.hypixel.hytale.procedurallib.logic;
public class ResultBuffer {
public static final Bounds2d bounds2d = new Bounds2d ();
public static final ResultBuffer2d buffer2d = new ResultBuffer2d ();
public static final ResultBuffer3d buffer3d = new ResultBuffer3d ();
public ResultBuffer () {
}
public static class ResultBuffer2d {
public int hash;
public int hash2;
public int ix;
public int iy;
public int ix2;
public int iy2;
public double distance;
public double distance2;
x;
y;
x2;
y2;
{
}
{
(distance < .distance) {
.ix = ix;
.iy = iy;
.distance = distance;
.x = x;
.y = y;
.hash = hash;
}
}
{
(distance < .distance) {
.distance2 = .distance;
.x2 = .x;
.y2 = .y;
.ix2 = .ix;
.iy2 = .iy;
.distance = distance;
.x = x;
.y = y;
.ix = ix;
.iy = iy;
.hash2 = .hash;
.hash = hash;
} (distance < .distance2) {
.distance2 = distance;
.x2 = x;
.y2 = y;
.ix2 = ix;
.iy2 = iy;
.hash2 = hash;
}
}
}
{
hash;
hash2;
ix;
iy;
iz;
ix2;
iy2;
iz2;
distance;
distance2;
x;
y;
z;
x2;
y2;
z2;
{
}
{
(distance < .distance) {
.hash = hash;
.ix = ix;
.iy = iy;
.iz = iz;
.distance = distance;
.x = x;
.y = y;
.z = z;
}
}
{
(distance < .distance) {
.distance2 = .distance;
.x2 = .x;
.y2 = .y;
.z2 = .z;
.ix2 = .ix;
.iy2 = .iy;
.iz2 = .iz;
.distance = distance;
.x = x;
.y = y;
.z = z;
.ix = ix;
.iy = iy;
.iz = iz;
.hash2 = .hash;
.hash = hash;
} (distance < .distance2) {
.distance2 = distance;
.x2 = x;
.y2 = y;
.z2 = z;
.ix2 = ix;
.iy2 = iy;
.iz2 = iz;
.hash2 = hash;
}
}
}
{
minX;
minY;
maxX;
maxY;
{
}
{
.minX = minX;
.minY = minY;
.maxX = maxX;
.maxY = maxY;
}
{
x >= .minX && x <= .maxX && y >= .minY && y <= .maxY;
}
}
}
com/hypixel/hytale/procedurallib/logic/SimplexNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import javax.annotation.Nonnull;
public class SimplexNoise implements NoiseFunction {
public static final SimplexNoise INSTANCE = new SimplexNoise ();
private static final double F2 = 0.5 ;
private static final double P1_F2 = -0.5 ;
private static final double G2 = 0.25 ;
private static final double F3 = 0.3333333333333333 ;
private static final double G3 = 0.16666666666666666 ;
private - ;
{
}
{
(x + y) * ;
GeneralNoise.fastFloor(x + t);
GeneralNoise.fastFloor(y + t);
t = ( )(i + j) * ;
( )i - t;
( )j - t;
x - X0;
y - Y0;
i1;
j1;
(x0 > y0) {
i1 = ;
j1 = ;
} {
i1 = ;
j1 = ;
}
t = - x0 * x0 - y0 * y0;
n0;
(t < ) {
n0 = ;
} {
t *= t;
n0 = t * t * GeneralNoise.gradCoord2D(offsetSeed, i, j, x0, y0);
}
x0 - ( )i1 + ;
y0 - ( )j1 + ;
t = - x1 * x1 - y1 * y1;
n1;
(t < ) {
n1 = ;
} {
t *= t;
n1 = t * t * GeneralNoise.gradCoord2D(offsetSeed, i + i1, j + j1, x1, y1);
}
x0 + - ;
y0 + - ;
t = - x2 * x2 - y2 * y2;
n2;
(t < ) {
n2 = ;
} {
t *= t;
n2 = t * t * GeneralNoise.gradCoord2D(offsetSeed, i + , j + , x2, y2);
}
* (n0 + n1 + n2);
}
{
(x + y + z) * ;
GeneralNoise.fastFloor(x + t);
GeneralNoise.fastFloor(y + t);
GeneralNoise.fastFloor(z + t);
t = ( )(i + j + k) * ;
x - (( )i - t);
y - (( )j - t);
z - (( )k - t);
i1;
j1;
k1;
i2;
j2;
k2;
(x0 >= y0) {
(y0 >= z0) {
i1 = ;
j1 = ;
k1 = ;
i2 = ;
j2 = ;
k2 = ;
} (x0 >= z0) {
i1 = ;
j1 = ;
k1 = ;
i2 = ;
j2 = ;
k2 = ;
} {
i1 = ;
j1 = ;
k1 = ;
i2 = ;
j2 = ;
k2 = ;
}
} (y0 < z0) {
i1 = ;
j1 = ;
k1 = ;
i2 = ;
j2 = ;
k2 = ;
} (x0 < z0) {
i1 = ;
j1 = ;
k1 = ;
i2 = ;
j2 = ;
k2 = ;
} {
i1 = ;
j1 = ;
k1 = ;
i2 = ;
j2 = ;
k2 = ;
}
x0 - ( )i1 + ;
y0 - ( )j1 + ;
z0 - ( )k1 + ;
x0 - ( )i2 + ;
y0 - ( )j2 + ;
z0 - ( )k2 + ;
x0 + - ;
y0 + - ;
z0 + - ;
t = - x0 * x0 - y0 * y0 - z0 * z0;
n0;
(t < ) {
n0 = ;
} {
t *= t;
n0 = t * t * GeneralNoise.gradCoord3D(offsetSeed, i, j, k, x0, y0, z0);
}
t = - x1 * x1 - y1 * y1 - z1 * z1;
n1;
(t < ) {
n1 = ;
} {
t *= t;
n1 = t * t * GeneralNoise.gradCoord3D(offsetSeed, i + i1, j + j1, k + k1, x1, y1, z1);
}
t = - x2 * x2 - y2 * y2 - z2 * z2;
n2;
(t < ) {
n2 = ;
} {
t *= t;
n2 = t * t * GeneralNoise.gradCoord3D(offsetSeed, i + i2, j + j2, k + k2, x2, y2, z2);
}
t = - x3 * x3 - y3 * y3 - z3 * z3;
n3;
(t < ) {
n3 = ;
} {
t *= t;
n3 = t * t * GeneralNoise.gradCoord3D(offsetSeed, i + , j + , k + , x3, y3, z3);
}
* (n0 + n1 + n2 + n3);
}
String {
;
}
}
com/hypixel/hytale/procedurallib/logic/ValueNoise.java
package com.hypixel.hytale.procedurallib.logic;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import javax.annotation.Nonnull;
public class ValueNoise implements NoiseFunction {
protected final GeneralNoise.InterpolationFunction interpolationFunction;
public ValueNoise (GeneralNoise.InterpolationFunction interpolationFunction) {
this .interpolationFunction = interpolationFunction;
}
public GeneralNoise.InterpolationFunction getInterpolationFunction () {
return this .interpolationFunction;
}
public double get (int seed, int offsetSeed, double x, double y) {
int x0 = GeneralNoise.fastFloor(x);
int y0 = GeneralNoise.fastFloor(y);
int x1 = x0 + 1 ;
int y1 = y0 + 1 ;
double xs = this .interpolationFunction.interpolate(x - ( )x0);
.interpolationFunction.interpolate(y - ( )y0);
GeneralNoise.lerp(HashUtil.random(( )offsetSeed, ( )x0, ( )y0), HashUtil.random(( )offsetSeed, ( )x1, ( )y0), xs);
GeneralNoise.lerp(HashUtil.random(( )offsetSeed, ( )x0, ( )y1), HashUtil.random(( )offsetSeed, ( )x1, ( )y1), xs);
GeneralNoise.lerp(xf0, xf1, ys) * - ;
}
{
GeneralNoise.fastFloor(x);
GeneralNoise.fastFloor(y);
GeneralNoise.fastFloor(z);
x0 + ;
y0 + ;
z0 + ;
.interpolationFunction.interpolate(x - ( )x0);
.interpolationFunction.interpolate(y - ( )y0);
.interpolationFunction.interpolate(z - ( )z0);
GeneralNoise.lerp(HashUtil.random(( )offsetSeed, ( )x0, ( )y0, ( )z0), HashUtil.random(( )offsetSeed, ( )x1, ( )y0, ( )z0), xs);
GeneralNoise.lerp(HashUtil.random(( )offsetSeed, ( )x0, ( )y1, ( )z0), HashUtil.random(( )offsetSeed, ( )x1, ( )y1, ( )z0), xs);
GeneralNoise.lerp(HashUtil.random(( )offsetSeed, ( )x0, ( )y0, ( )z1), HashUtil.random(( )offsetSeed, ( )x1, ( )y0, ( )z1), xs);
GeneralNoise.lerp(HashUtil.random(( )offsetSeed, ( )x0, ( )y1, ( )z1), HashUtil.random(( )offsetSeed, ( )x1, ( )y1, ( )z1), xs);
GeneralNoise.lerp(xf00, xf10, ys);
GeneralNoise.lerp(xf01, xf11, ys);
GeneralNoise.lerp(yf0, yf1, zs) * - ;
}
String {
+ String.valueOf( .interpolationFunction) + ;
}
}
com/hypixel/hytale/procedurallib/logic/cell/BorderDistanceFunction.java
package com.hypixel.hytale.procedurallib.logic.cell;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.DensityPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.JitterPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.NormalPointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import javax.annotation.Nonnull;
public class BorderDistanceFunction implements CellDistanceFunction {
protected final CellDistanceFunction distanceFunction;
@Nonnull
protected final PointEvaluator cellEvaluator;
@Nonnull
protected final PointEvaluator borderEvaluator;
@Nonnull
protected final IIntCondition density;
public BorderDistanceFunction (CellDistanceFunction distanceFunction, @Nonnull PointEvaluator borderEvaluator, IDoubleCondition density) {
this .distanceFunction = distanceFunction;
this .borderEvaluator = borderEvaluator;
this .cellEvaluator = new JitterPointEvaluator (NormalPointEvaluator.EUCLIDEAN, borderEvaluator.getJitter());
.density = DensityPointEvaluator.getDensityCondition(density);
}
{
.distanceFunction.scale(value);
}
{
.distanceFunction.invScale(value);
}
{
.distanceFunction.getCellX(x, y);
}
{
.distanceFunction.getCellY(x, y);
}
{
.transition2D(seed, x, y, cellX, cellY, buffer, pointEvaluator);
}
{
.distanceFunction.nearest2D(seed, x, y, cellX, cellY, buffer, .cellEvaluator);
(! .density.eval(buffer.hash)) {
buffer.distance = ;
} {
cellX = buffer.ix;
cellY = buffer.iy;
buffer.ix2 = cellX;
buffer.iy2 = cellY;
buffer.x2 = buffer.x;
buffer.y2 = buffer.y;
buffer.distance = / ;
buffer.distance2 = / ;
.borderEvaluator.getJitter().getMaxX() > ? : ;
.borderEvaluator.getJitter().getMaxY() > ? : ;
( cellY - dy; cy <= cellY + dy; ++cy) {
( cellX - dx; cx <= cellX + dx; ++cx) {
.distanceFunction.evalPoint2(seed, x, y, cx, cy, buffer, .borderEvaluator);
}
}
}
}
{
();
}
{
();
}
{
();
}
{
();
}
{
();
}
{
();
}
<T> {
.distanceFunction.collect(originalSeed, seed, minX, minY, maxX, maxY, bounds, ctx, collector, pointEvaluator);
}
String {
String.valueOf( .distanceFunction);
+ var10000 + + String.valueOf( .cellEvaluator) + + String.valueOf( .borderEvaluator) + + String.valueOf( .density) + ;
}
}
com/hypixel/hytale/procedurallib/logic/cell/CellDistanceFunction.java
package com.hypixel.hytale.procedurallib.logic.cell;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
public interface CellDistanceFunction {
default double scale (double value) {
return value;
}
default double invScale (double value) {
return value;
}
default int getCellX (double x, double y) {
return MathUtil.floor(x);
}
default int getCellY (double x, double y) {
return MathUtil.floor(y);
}
default int getCellX (double x, double y, double z) {
return MathUtil.floor(x);
}
default int getCellY (double x, y, z) {
MathUtil.floor(y);
}
{
MathUtil.floor(z);
}
;
;
;
;
;
;
;
;
<T> ;
}
com/hypixel/hytale/procedurallib/logic/cell/CellPointFunction.java
package com.hypixel.hytale.procedurallib.logic.cell;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
public interface CellPointFunction {
default double scale (double value) {
return value;
}
default double normalize (double value) {
return value;
}
int getHash (int var1, int var2, int var3) ;
double getX (double var1, double var3) ;
double getY (double var1, double var3) ;
DoubleArray.Double2 getOffsets (int var1) ;
}
com/hypixel/hytale/procedurallib/logic/cell/CellType.java
package com.hypixel.hytale.procedurallib.logic.cell;
public enum CellType {
SQUARE,
HEX;
private CellType () {
}
}
com/hypixel/hytale/procedurallib/logic/cell/DistanceCalculationMode.java
package com.hypixel.hytale.procedurallib.logic.cell;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public enum DistanceCalculationMode {
EUCLIDEAN(new PointDistanceFunction () {
public double distance2D (double deltaX, double deltaY) {
return deltaX * deltaX + deltaY * deltaY;
}
public double distance3D (double deltaX, double deltaY, double deltaZ) {
return deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;
}
@Nonnull
public String toString () {
return "EuclideanPointDistanceFunction{}" ;
}
}),
MANHATTAN(new PointDistanceFunction () {
public double distance2D (double deltaX, double deltaY) {
return Math.abs(deltaX) + Math.abs(deltaY);
}
public double distance3D (double deltaX, double deltaY, double deltaZ) {
Math.abs(deltaX) + Math.abs(deltaY) + Math.abs(deltaZ);
}
String {
;
}
}),
NATURAL( () {
{
Math.abs(deltaX) + Math.abs(deltaY) + deltaX * deltaX + deltaY * deltaY;
}
{
Math.abs(deltaX) + Math.abs(deltaY) + Math.abs(deltaZ) + deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;
}
String {
;
}
}),
MAX( () {
{
Math.max(Math.abs(deltaX), Math.abs(deltaY));
}
{
Math.max(Math.abs(deltaX), Math.max(Math.abs(deltaY), Math.abs(deltaZ)));
}
String {
;
}
});
DistanceCalculationMode[] VALUES = values();
PointDistanceFunction function;
{
.function = function;
}
PointDistanceFunction {
.function;
}
DistanceCalculationMode {
(DistanceCalculationMode mode : VALUES) {
(mode.function == function) {
mode;
}
}
;
}
}
com/hypixel/hytale/procedurallib/logic/cell/GridCellDistanceFunction.java
package com.hypixel.hytale.procedurallib.logic.cell;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.logic.CellularNoise;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import javax.annotation.Nonnull;
public class GridCellDistanceFunction implements CellDistanceFunction {
public static final GridCellDistanceFunction DISTANCE_FUNCTION = new GridCellDistanceFunction ();
public static final CellPointFunction POINT_FUNCTION = new CellPointFunction () {
public int getHash (int seed, int cellX, int cellY) {
return GridCellDistanceFunction.getHash(seed, cellX, cellY);
}
public DoubleArray.Double2 getOffsets (int hash) {
CellularNoise.CELL_2D[hash & ];
}
{
x;
}
{
y;
}
};
{
}
{
( cellY - ; cy <= cellY + ; ++cy) {
( cellX - ; cx <= cellX + ; ++cx) {
.evalPoint(seed, x, y, cx, cy, buffer, pointEvaluator);
}
}
}
{
( cellX - ; cx <= cellX + ; ++cx) {
( cellY - ; cy <= cellY + ; ++cy) {
( cellZ - ; cz <= cellZ + ; ++cz) {
.evalPoint(seed, x, y, z, cx, cy, cz, buffer, pointEvaluator);
}
}
}
}
{
( cellY - ; cy <= cellY + ; ++cy) {
( cellX - ; cx <= cellX + ; ++cx) {
.evalPoint2(seed, x, y, cx, cy, buffer, pointEvaluator);
}
}
}
{
( cellX - ; cx <= cellX + ; ++cx) {
( cellY - ; cy <= cellY + ; ++cy) {
( cellZ - ; cz <= cellZ + ; ++cz) {
.evalPoint2(seed, x, y, z, cx, cy, cz, buffer, pointEvaluator);
}
}
}
}
{
getHash(seed, cellX, cellY);
DoubleArray. CellularNoise.CELL_2D[cellHash & ];
pointEvaluator.getJitter();
jitter.getPointX(cellX, vec);
jitter.getPointY(cellY, vec);
pointEvaluator.evalPoint(seed, x, y, cellHash, cellX, cellY, px, py, buffer);
}
{
getHash(seed, cellX, cellY);
DoubleArray. CellularNoise.CELL_3D[cellHash & ];
pointEvaluator.getJitter();
jitter.getPointX(cellX, vec);
jitter.getPointY(cellX, vec);
jitter.getPointZ(cellX, vec);
pointEvaluator.evalPoint(seed, x, y, z, cellHash, cellX, cellY, cellZ, px, py, pz, buffer);
}
{
getHash(seed, cellX, cellY);
DoubleArray. CellularNoise.CELL_2D[cellHash & ];
pointEvaluator.getJitter();
jitter.getPointX(cellX, vec);
jitter.getPointY(cellY, vec);
pointEvaluator.evalPoint2(seed, x, y, cellHash, cellX, cellY, px, py, buffer);
}
{
getHash(seed, cellX, cellY);
DoubleArray. CellularNoise.CELL_3D[cellHash & ];
pointEvaluator.getJitter();
jitter.getPointX(cellX, vec);
jitter.getPointY(cellX, vec);
jitter.getPointZ(cellX, vec);
pointEvaluator.evalPoint2(seed, x, y, z, cellHash, cellX, cellY, cellZ, px, py, pz, buffer);
}
<T> {
pointEvaluator.getJitter();
( minY; cy <= maxY; ++cy) {
( minX; cx <= maxX; ++cx) {
getHash(seed, cx, cy);
DoubleArray. CellularNoise.CELL_2D[cellHash & ];
jitter.getPointX(cx, vec);
jitter.getPointY(cy, vec);
pointEvaluator.collectPoint(cellHash, cx, cy, px, py, ctx, collector);
}
}
}
String {
;
}
{
( )HashUtil.rehash(( )seed, ( )cellX, ( )cellY);
}
}
com/hypixel/hytale/procedurallib/logic/cell/HexCellDistanceFunction.java
package com.hypixel.hytale.procedurallib.logic.cell;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.logic.CellularNoise;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
public class HexCellDistanceFunction implements CellDistanceFunction {
public static final HexCellDistanceFunction DISTANCE_FUNCTION = new HexCellDistanceFunction ();
public static final CellPointFunction POINT_FUNCTION = new CellPointFunction () {
public double scale (double value) {
return value * HexCellDistanceFunction.SCALE;
}
public double normalize (double value) {
value * ;
}
{
HexCellDistanceFunction.getHash(seed, cellX, cellY);
}
{
HexCellDistanceFunction.toHexX(x, y);
}
{
HexCellDistanceFunction.toHexY(x, y);
}
DoubleArray.Double2 {
HexCellDistanceFunction.HEX_CELL_2D[hash & ];
}
};
Math.sqrt( ) / ;
- ;
;
Math.sqrt( );
Math.sqrt( ) / ;
;
;
SCALE;
DoubleArray.Double2[] HEX_CELL_2D;
{
}
{
value * SCALE;
}
{
value / SCALE;
}
{
toGridX(x, y);
}
{
toGridY(x, y);
}
{
.evalPoint(seed, x, y, cellX - , cellY - , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
buffer.distance *= ;
}
{
();
}
{
.evalPoint2(seed, x, y, cellX - , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
pointEvaluator.getJitter();
(jitter.getMaxX() > ) {
.evalPoint2(seed, x, y, cellX - , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
}
(jitter.getMaxY() > ) {
.evalPoint2(seed, x, y, cellX - , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY - , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX - , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
.evalPoint2(seed, x, y, cellX + , cellY + , buffer, pointEvaluator);
}
buffer.distance *= ;
buffer.distance2 *= ;
}
{
();
}
{
getHash(seed, cellX, cellY);
DoubleArray. HEX_CELL_2D[cellHash & ];
pointEvaluator.getJitter();
jitter.getPointX(cellX, vec);
jitter.getPointY(cellY, vec);
toHexX(px, py);
toHexY(px, py);
pointEvaluator.evalPoint(seed, x, y, cellHash, cellX, cellY, hx, hy, buffer);
}
{
();
}
{
getHash(seed, cellX, cellY);
DoubleArray. HEX_CELL_2D[cellHash & ];
pointEvaluator.getJitter();
jitter.getPointX(cellX, vec);
jitter.getPointY(cellY, vec);
toHexX(px, py);
toHexY(px, py);
pointEvaluator.evalPoint2(seed, x, y, cellHash, cellX, cellY, hx, hy, buffer);
}
{
();
}
<T> {
--minX;
--minY;
++maxX;
++maxY;
maxY - minY;
maxX - minX + (height >> );
pointEvaluator.getJitter();
( ; dy <= height; ++dy) {
minY + dy;
minX - (dy >> );
( ; dx <= width; ++dx) {
startX + dx;
getHash(seed, cx, cy);
DoubleArray. HEX_CELL_2D[cellHash & ];
jitter.getPointX(cx, vec);
jitter.getPointY(cy, vec);
toHexX(px, py);
toHexY(px, py);
(bounds.contains(hx, hy)) {
hx /= SCALE;
hy /= SCALE;
pointEvaluator.collectPoint(cellHash, cx, cy, hx, hy, ctx, collector);
}
}
}
}
String {
;
}
{
HexCellDistanceFunction.SquirrelHash.hash(seed, x, y);
}
{
( )MathUtil.fastRound(X_TO_GRID_X * x + - * y);
}
{
( )MathUtil.fastRound( * y);
}
{
X_TO_HEX_X * hx + Y_TO_HEX_X * hy;
}
{
* hy;
}
{
SCALE = (X_TO_HEX_X + ) / ;
HEX_CELL_2D = (DoubleArray.Double2[])Stream.of(CellularNoise.CELL_2D).map((d) -> .Double2(d.x - , d.y - )).toArray((x$ ) -> .Double2[x$ ]);
}
{
;
- ;
- ;
- ;
{
}
{
x + y * ;
hash *= - ;
hash += seed;
hash ^= hash >> ;
hash -= ;
hash ^= hash << ;
hash *= - ;
hash ^= hash >> ;
hash;
}
}
}
com/hypixel/hytale/procedurallib/logic/cell/MeasurementMode.java
package com.hypixel.hytale.procedurallib.logic.cell;
public enum MeasurementMode {
CENTRE_DISTANCE,
BORDER_DISTANCE;
private MeasurementMode () {
}
}
com/hypixel/hytale/procedurallib/logic/cell/PointDistanceFunction.java
package com.hypixel.hytale.procedurallib.logic.cell;
public interface PointDistanceFunction {
double distance2D (double var1, double var3) ;
double distance3D (double var1, double var3, double var5) ;
default double distance2D (int seed, int cellX, int cellY, double cellCentreX, double cellCentreY, double deltaX, double deltaY) {
return this .distance2D(deltaX, deltaY);
}
default double distance3D (int seed, int cellX, int cellY, int cellZ, double cellCentreX, double cellCentreY, double cellCentreZ, double deltaX, double deltaY, double deltaZ) {
return this .distance3D(deltaX, deltaY, deltaZ);
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/BorderPointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import javax.annotation.Nonnull;
public class BorderPointEvaluator implements PointEvaluator {
public static final BorderPointEvaluator INSTANCE = new BorderPointEvaluator ();
public BorderPointEvaluator () {
}
public void evalPoint (int seed, double x, double y, int cellHash, int cellX, int cellY, double cellPointX, double cellPointY, @Nonnull ResultBuffer.ResultBuffer2d buffer) {
if (!isOrigin(cellX, cellY, buffer)) {
double distance = getBorderDistance(x, y, buffer.x2, buffer.y2, cellPointX, cellPointY);
if (distance < buffer.distance) {
buffer.distance = distance;
}
}
}
public void evalPoint2 (int seed, double x, double y, cellHash, cellX, cellY, cellPointX, cellPointY, ResultBuffer.ResultBuffer2d buffer) {
(!isOrigin(cellX, cellY, buffer)) {
getBorderDistance(x, y, buffer.x2, buffer.y2, cellPointX, cellPointY);
(distance < buffer.distance) {
buffer.distance2 = buffer.distance;
buffer.distance = distance;
} (distance < buffer.distance2) {
buffer.distance2 = distance;
}
}
}
{
();
}
{
();
}
String {
;
}
{
cellX == buffer.ix2 && cellY == buffer.iy2;
}
{
(cellPointX + originX) * ;
(cellPointY + originY) * ;
-(cellPointY - originY);
cellPointX - originX;
ax + normX;
ay + normY;
MathUtil.distanceToInfLineSq(x, y, ax, ay, bx, by);
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/BranchEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.vector.Vector2i;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.CellPointFunction;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import javax.annotation.Nonnull;
public class BranchEvaluator implements PointEvaluator {
protected static final int CARDINAL_MASK = 1 ;
protected static final int CARDINAL_MASK_RESULT_X = 0 ;
protected static final int CARDINAL_MASK_RESULT_Y = 1 ;
protected static final int RANDOM_DIRECTION_MASK = 3 ;
protected static final Vector2i[] RANDOM_DIRECTIONS = []{ ( , ), ( , - ), (- , ), (- , - )};
CellPointFunction pointFunction;
Direction direction;
CellJitter jitter;
branch2parentScale;
invLineNormalization;
{
.pointFunction = linePointFunction;
.direction = direction;
.jitter = jitter;
/ linePointFunction.scale(branchScale);
.branch2parentScale = parentFunction.scale(inverseScalar);
.invLineNormalization = / linePointFunction.normalize( );
}
CellJitter {
.jitter;
}
{
getConnectionX( .direction, buffer.ix2, buffer.x2, hashA, ax * .branch2parentScale);
getConnectionY( .direction, buffer.ix2, buffer.y2, hashA, ay * .branch2parentScale);
cax + dx;
cay + dy;
.pointFunction.getHash(seed, cbx, cby);
DoubleArray. .pointFunction.getOffsets(hashB);
.getJitter().getPointX(cbx, offsetsB);
.getJitter().getPointY(cby, offsetsB);
.pointFunction.getX(rawBx, rawBy);
.pointFunction.getY(rawBx, rawBy);
(checkBounds(x, y, ax, ay, bx, by, buffer.distance2)) {
MathUtil.distanceToLineSq(x, y, ax, ay, bx, by);
dist2 *= .invLineNormalization;
buffer.register(hashA, cax, cay, dist2, ax, ay);
}
}
{
}
{
}
{
}
{
((cellHash & ) != ) {
;
} {
var10000;
(direction.ordinal()) {
-> var10000 = cellCoord < regionCoord ? - : ;
-> var10000 = cellCoord > regionCoord ? - : ;
-> var10000 = RANDOM_DIRECTIONS[regionHash & ].x;
-> ((String) , (Throwable) );
}
var10000;
}
}
{
((cellHash & ) != ) {
;
} {
var10000;
(direction.ordinal()) {
-> var10000 = cellCoord < regionCoord ? - : ;
-> var10000 = cellCoord > regionCoord ? - : ;
-> var10000 = RANDOM_DIRECTIONS[regionHash & ].y;
-> ((String) , (Throwable) );
}
var10000;
}
}
{
Math.min(ax, bx) - thickness;
Math.min(ay, by) - thickness;
Math.max(ax, bx) + thickness;
Math.max(ay, by) + thickness;
x > minX && x < maxX && y > minY && y < maxY;
}
{
OUTWARD,
INWARD,
RANDOM;
{
}
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/DensityPointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.IIntCondition;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class DensityPointEvaluator implements PointEvaluator {
protected final PointEvaluator pointEvaluator;
protected final IIntCondition density;
public DensityPointEvaluator (PointEvaluator pointEvaluator, IDoubleCondition density) {
this (pointEvaluator, getDensityCondition(density));
}
public DensityPointEvaluator (PointEvaluator pointEvaluator, IIntCondition density) {
this .pointEvaluator = pointEvaluator;
this .density = density;
}
public CellJitter getJitter () {
return this .pointEvaluator.getJitter();
}
public void evalPoint (int seed, double x, double y, cellHash, cellX, cellY, cellPointX, cellPointY, ResultBuffer.ResultBuffer2d buffer) {
( .density.eval(cellHash)) {
.pointEvaluator.evalPoint(seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, buffer);
}
}
{
( .density.eval(cellHash)) {
.pointEvaluator.evalPoint2(seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, buffer);
}
}
{
( .density.eval(cellHash)) {
.pointEvaluator.evalPoint(seed, x, y, z, cellHash, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, buffer);
}
}
{
( .density.eval(cellHash)) {
.pointEvaluator.evalPoint2(seed, x, y, z, cellHash, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, buffer);
}
}
<T> {
( .density.eval(cellHash)) {
.pointEvaluator.collectPoint(cellHash, cellX, cellY, x, y, t, consumer);
}
}
String {
String.valueOf( .pointEvaluator);
+ var10000 + + String.valueOf( .density) + ;
}
IIntCondition {
threshold == ? (seed) -> : (seed) -> threshold.eval(randomDensityCondition(seed));
}
{
HashUtil.random(( )seed, - );
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/DistancePointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import com.hypixel.hytale.procedurallib.supplier.ISeedDoubleRange;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class DistancePointEvaluator implements PointEvaluator {
protected final PointDistanceFunction distanceFunction;
protected final ISeedDoubleRange distanceMod;
public DistancePointEvaluator (PointDistanceFunction distanceFunction, IDoubleRange distanceMod) {
this (distanceFunction, getDistanceModifier(distanceMod));
}
public DistancePointEvaluator (PointDistanceFunction distanceFunction, ISeedDoubleRange distanceMod) {
this .distanceFunction = distanceFunction;
this .distanceMod = distanceMod;
}
public void evalPoint (int seed, double x, double y, int cellHash, int cellX, int cellY, double cellPointX, double cellPointY, @Nonnull ResultBuffer.ResultBuffer2d buffer) {
.distanceFunction.distance2D(seed, cellX, cellY, cellPointX, cellPointY, cellPointX - x, cellPointY - y);
distance = .distanceMod.getValue(cellHash, distance);
buffer.register(cellHash, cellX, cellY, distance, cellPointX, cellPointY);
}
{
.distanceFunction.distance2D(seed, cellX, cellY, cellPointX, cellPointY, cellPointX - x, cellPointY - y);
distance = .distanceMod.getValue(cellHash, distance);
buffer.register2(cellHash, cellX, cellY, distance, cellPointX, cellPointY);
}
{
.distanceFunction.distance3D(seed, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, cellPointX - x, cellPointY - y, cellPointZ - z);
distance = .distanceMod.getValue(cellHash, distance);
buffer.register(cellHash, cellX, cellY, cellZ, distance, cellPointX, cellPointY, cellPointZ);
}
{
.distanceFunction.distance3D(seed, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, cellPointX - x, cellPointY - y, cellPointZ - z);
distance = .distanceMod.getValue(cellHash, distance);
buffer.register2(cellHash, cellX, cellY, cellZ, distance, cellPointX, cellPointY, cellPointZ);
}
String {
String.valueOf( .distanceFunction);
+ var10000 + + String.valueOf( .distanceMod) + ;
}
ISeedDoubleRange {
range == ? ISeedDoubleRange.DIRECT : (seed, value) -> value * range.getValue(randomDistanceModification(seed));
}
{
HashUtil.random(( )seed, );
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/JitterPointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import javax.annotation.Nonnull;
public class JitterPointEvaluator implements PointEvaluator {
protected final PointEvaluator pointEvaluator;
protected final CellJitter jitter;
public JitterPointEvaluator (PointEvaluator pointEvaluator, CellJitter jitter) {
this .pointEvaluator = pointEvaluator;
this .jitter = jitter;
}
public CellJitter getJitter () {
return this .jitter;
}
public void evalPoint (int seed, double x, double y, int cellHash, int cellX, int cellY, double cellPointX, double cellPointY, ResultBuffer.ResultBuffer2d buffer) {
this .pointEvaluator.evalPoint(seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, buffer);
}
public void evalPoint2 (int seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, ResultBuffer.ResultBuffer2d buffer) {
.pointEvaluator.evalPoint2(seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, buffer);
}
{
.pointEvaluator.evalPoint(seed, x, y, z, cellHash, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, buffer);
}
{
.pointEvaluator.evalPoint2(seed, x, y, z, cellHash, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, buffer);
}
<T> {
.pointEvaluator.collectPoint(cellHash, cellX, cellY, cellCentreX, cellCentreY, ctx, consumer);
}
String {
String.valueOf( .pointEvaluator);
+ var10000 + + String.valueOf( .jitter) + ;
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/NormalPointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import javax.annotation.Nonnull;
public class NormalPointEvaluator implements PointEvaluator {
public static final PointEvaluator EUCLIDEAN;
public static final PointEvaluator MANHATTAN;
public static final PointEvaluator NATURAL;
public static final PointEvaluator MAX;
protected final PointDistanceFunction distanceFunction;
public NormalPointEvaluator (PointDistanceFunction distanceFunction) {
this .distanceFunction = distanceFunction;
}
public void evalPoint (int seed, double x, double y, int cellHash, int cellX, int cellY, double cellPointX, double cellPointY, @Nonnull ResultBuffer.ResultBuffer2d buffer) {
double distance = .distanceFunction.distance2D(seed, cellX, cellY, cellPointX, cellPointY, cellPointX - x, cellPointY - y);
buffer.register(cellHash, cellX, cellY, distance, cellPointX, cellPointY);
}
{
.distanceFunction.distance2D(seed, cellX, cellY, cellPointX, cellPointY, cellPointX - x, cellPointY - y);
buffer.register2(cellHash, cellX, cellY, distance, cellPointX, cellPointY);
}
{
.distanceFunction.distance3D(seed, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, cellPointX - x, cellPointY - y, cellPointZ - z);
buffer.register(cellHash, cellX, cellY, cellZ, distance, cellPointX, cellPointY, cellPointZ);
}
{
.distanceFunction.distance3D(seed, cellX, cellY, cellZ, cellPointX, cellPointY, cellPointZ, cellPointX - x, cellPointY - y, cellPointZ - z);
buffer.register2(cellHash, cellX, cellY, cellZ, distance, cellPointX, cellPointY, cellPointZ);
}
String {
+ String.valueOf( .distanceFunction) + ;
}
PointEvaluator {
DistanceCalculationMode.from(distanceFunction);
(mode == ) {
(distanceFunction);
} {
PointEvaluator var10000;
(mode) {
EUCLIDEAN -> var10000 = EUCLIDEAN;
MANHATTAN -> var10000 = MANHATTAN;
NATURAL -> var10000 = NATURAL;
MAX -> var10000 = MAX;
-> ((String) , (Throwable) );
}
var10000;
}
}
{
EUCLIDEAN = (DistanceCalculationMode.EUCLIDEAN.getFunction());
MANHATTAN = (DistanceCalculationMode.MANHATTAN.getFunction());
NATURAL = (DistanceCalculationMode.NATURAL.getFunction());
MAX = (DistanceCalculationMode.MAX.getFunction());
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/PointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.procedurallib.condition.DefaultDoubleCondition;
import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.PointDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.DefaultCellJitter;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import com.hypixel.hytale.procedurallib.supplier.IDoubleRange;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface PointEvaluator {
default CellJitter getJitter () {
return DefaultCellJitter.DEFAULT_ONE;
}
void evalPoint (int var1, double var2, double var4, int var6, int var7, int var8, double var9, double var11, ResultBuffer.ResultBuffer2d var13) ;
void evalPoint2 (int var1, double var2, double var4, int var6, int var7, int var8, double var9, double var11, ResultBuffer.ResultBuffer2d var13) ;
void ;
;
<T> {
consumer.accept(cellCentreX, cellCentreY, ctx);
}
PointEvaluator {
of(distanceFunction, density, distanceMod, , SkipCellPointEvaluator.DEFAULT_MODE, jitter);
}
PointEvaluator {
NormalPointEvaluator.of(distanceFunction);
(distanceMod != ) {
pointEvaluator = (distanceFunction, distanceMod);
}
(density != && density != DefaultDoubleCondition.DEFAULT_TRUE) {
pointEvaluator = (pointEvaluator, density);
}
(skipCount > ) {
pointEvaluator = (pointEvaluator, skipMode, skipCount);
}
(jitter != DefaultCellJitter.DEFAULT_ONE) {
pointEvaluator = (pointEvaluator, jitter);
}
pointEvaluator;
}
}
com/hypixel/hytale/procedurallib/logic/cell/evaluator/SkipCellPointEvaluator.java
package com.hypixel.hytale.procedurallib.logic.cell.evaluator;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.jitter.CellJitter;
import com.hypixel.hytale.procedurallib.logic.point.PointConsumer;
import it.unimi.dsi.fastutil.HashCommon;
import javax.annotation.Nonnull;
public class SkipCellPointEvaluator implements PointEvaluator {
@Nonnull
protected final PointEvaluator pointEvaluator;
@Nonnull
protected final Mode mode;
protected final int mask;
protected final int mid;
public static final int DEFAULT_NO_SKIP = 0 ;
public static final Mode DEFAULT_MODE;
public SkipCellPointEvaluator (@Nonnull PointEvaluator pointEvaluator, @Nonnull Mode mode, int period) {
int interval = HashCommon.nextPowerOfTwo(Math.max(0 , period) + 1 );
this .pointEvaluator = pointEvaluator;
.mode = mode;
.mask = interval - ;
.mid = interval >> ;
}
CellJitter {
.pointEvaluator.getJitter();
}
{
(! .skip( .mode, cellX, cellY)) {
.pointEvaluator.evalPoint(seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, buffer);
}
}
{
(! .skip( .mode, cellX, cellY)) {
.pointEvaluator.evalPoint2(seed, x, y, cellHash, cellX, cellY, cellPointX, cellPointY, buffer);
}
}
{
}
{
}
<T> {
(! .skip( .mode, cellX, cellY)) {
.pointEvaluator.collectPoint(cellHash, cellX, cellY, cellCentreX, cellCentreY, ctx, consumer);
}
}
{
cx & .mask;
cy & .mask;
x0 == && y0 == || mode == SkipCellPointEvaluator.Mode.CHECKERBOARD && x0 == .mid && y0 == .mid;
!result;
}
{
DEFAULT_MODE = SkipCellPointEvaluator.Mode.CHECKERBOARD;
}
{
CHECKERBOARD,
GRID;
{
}
}
}
com/hypixel/hytale/procedurallib/logic/cell/jitter/CellJitter.java
package com.hypixel.hytale.procedurallib.logic.cell.jitter;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
import javax.annotation.Nonnull;
public interface CellJitter {
double getMaxX () ;
double getMaxY () ;
double getMaxZ () ;
double getPointX (int var1, DoubleArray.Double2 var2) ;
double getPointY (int var1, DoubleArray.Double2 var2) ;
double getPointX (int var1, DoubleArray.Double3 var2) ;
double getPointY (int var1, DoubleArray.Double3 var2) ;
double getPointZ (int var1, DoubleArray.Double3 var2) ;
@Nonnull
static CellJitter of (double x, double y, double z) {
return (CellJitter)(x == 1.0 && y == 1.0 && z == 1.0 ? DefaultCellJitter.DEFAULT_ONE : new ConstantCellJitter (x, y, z));
}
}
com/hypixel/hytale/procedurallib/logic/cell/jitter/ConstantCellJitter.java
package com.hypixel.hytale.procedurallib.logic.cell.jitter;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
import javax.annotation.Nonnull;
public class ConstantCellJitter implements CellJitter {
protected final double jitterX;
protected final double jitterY;
protected final double jitterZ;
public ConstantCellJitter (double jitterX, double jitterY, double jitterZ) {
this .jitterX = jitterX;
this .jitterY = jitterY;
this .jitterZ = jitterZ;
}
public double getMaxX () {
return this .jitterX;
}
public double getMaxY () {
return this .jitterY;
}
public double getMaxZ () {
return this .jitterZ;
}
public double getPointX ( cx, DoubleArray.Double2 vec) {
( )cx + vec.x * .jitterX;
}
{
( )cy + vec.y * .jitterY;
}
{
( )cx + vec.x * .jitterX;
}
{
( )cy + vec.y * .jitterY;
}
{
( )cz + vec.z * .jitterZ;
}
String {
+ .jitterX + + .jitterY + + .jitterZ + ;
}
}
com/hypixel/hytale/procedurallib/logic/cell/jitter/DefaultCellJitter.java
package com.hypixel.hytale.procedurallib.logic.cell.jitter;
import com.hypixel.hytale.procedurallib.logic.DoubleArray;
import javax.annotation.Nonnull;
public class DefaultCellJitter implements CellJitter {
public static final CellJitter DEFAULT_ONE = new DefaultCellJitter ();
public DefaultCellJitter () {
}
public double getMaxX () {
return 1.0 ;
}
public double getMaxY () {
return 1.0 ;
}
public double getMaxZ () {
return 1.0 ;
}
public double getPointX (int cx, @Nonnull DoubleArray.Double2 vec) {
return (double )cx + vec.x;
}
public double getPointY ( cy, DoubleArray.Double2 vec) {
( )cy + vec.y;
}
{
( )cx + vec.x;
}
{
( )cy + vec.y;
}
{
( )cz + vec.z;
}
String {
;
}
}
com/hypixel/hytale/procedurallib/logic/point/DistortedPointGenerator.java
package com.hypixel.hytale.procedurallib.logic.point;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.random.ICoordinateRandomizer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class DistortedPointGenerator implements IPointGenerator {
protected final IPointGenerator pointGenerator;
protected final ICoordinateRandomizer coordinateRandomizer;
public DistortedPointGenerator (IPointGenerator pointGenerator, ICoordinateRandomizer coordinateRandomizer) {
this .pointGenerator = pointGenerator;
this .coordinateRandomizer = coordinateRandomizer;
}
public ResultBuffer.ResultBuffer2d nearest2D (int seed, double x, double y) {
return this .pointGenerator.nearest2D(seed, this .coordinateRandomizer.randomDoubleX(seed, x, y), this .coordinateRandomizer.randomDoubleY(seed, x, y));
}
public ResultBuffer.ResultBuffer3d nearest3D (int seed, double x, double y, double z) {
return this .pointGenerator.nearest3D(seed, this .coordinateRandomizer.randomDoubleX(seed, x, y, z), this .coordinateRandomizer.randomDoubleY(seed, x, y, z), .coordinateRandomizer.randomDoubleZ(seed, x, y, z));
}
ResultBuffer.ResultBuffer2d {
.pointGenerator.transition2D(seed, .coordinateRandomizer.randomDoubleX(seed, x, y), .coordinateRandomizer.randomDoubleY(seed, x, y));
}
ResultBuffer.ResultBuffer3d {
.pointGenerator.transition3D(seed, .coordinateRandomizer.randomDoubleX(seed, x, y, z), .coordinateRandomizer.randomDoubleY(seed, x, y, z), .coordinateRandomizer.randomDoubleZ(seed, x, y, z));
}
{
.pointGenerator.getInterval();
}
{
.pointGenerator.collect(seed, minX, minY, maxX, maxY, consumer);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(DistortedPointGenerator)o;
! .pointGenerator.equals(that.pointGenerator) ? : .coordinateRandomizer.equals(that.coordinateRandomizer);
} {
;
}
}
{
.pointGenerator.hashCode();
result = * result + .coordinateRandomizer.hashCode();
result;
}
String {
String.valueOf( .pointGenerator);
+ var10000 + + String.valueOf( .coordinateRandomizer) + ;
}
}
com/hypixel/hytale/procedurallib/logic/point/IPointGenerator.java
package com.hypixel.hytale.procedurallib.logic.point;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
public interface IPointGenerator {
ResultBuffer.ResultBuffer2d nearest2D (int var1, double var2, double var4) ;
ResultBuffer.ResultBuffer3d nearest3D (int var1, double var2, double var4, double var6) ;
ResultBuffer.ResultBuffer2d transition2D (int var1, double var2, double var4) ;
ResultBuffer.ResultBuffer3d transition3D (int var1, double var2, double var4, double var6) ;
void collect (int var1, double var2, double var4, double var6, double var8, PointConsumer2d var10) ;
double getInterval () ;
@FunctionalInterface
public interface PointConsumer2d {
void accept (double var1, double var3) ;
}
}
com/hypixel/hytale/procedurallib/logic/point/OffsetPointGenerator.java
package com.hypixel.hytale.procedurallib.logic.point;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import javax.annotation.Nonnull;
public class OffsetPointGenerator implements IPointGenerator {
private final IPointGenerator generator;
private final double offsetX;
private final double offsetY;
private final double offsetZ;
public OffsetPointGenerator (IPointGenerator generator, double offsetX, double offsetY, double offsetZ) {
this .generator = generator;
this .offsetX = offsetX;
this .offsetY = offsetY;
this .offsetZ = offsetZ;
}
public double getOffsetX () {
return this .offsetX;
}
public double getOffsetY () {
return this .offsetY;
}
public double getOffsetZ () {
return .offsetZ;
}
ResultBuffer.ResultBuffer2d {
.generator.nearest2D(seed, x + .offsetX, y + .offsetY);
}
ResultBuffer.ResultBuffer3d {
.generator.nearest3D(seed, x + .offsetX, y + .offsetY, z + .offsetZ);
}
ResultBuffer.ResultBuffer2d {
.generator.transition2D(seed, x + .offsetX, y + .offsetY);
}
ResultBuffer.ResultBuffer3d {
.generator.transition3D(seed, x + .offsetX, y + .offsetY, z + .offsetZ);
}
{
.generator.collect(seed, minX, minY, maxX, maxY, (x, y) -> consumer.accept(x + .offsetX, y + .offsetY));
}
{
.generator.getInterval();
}
}
com/hypixel/hytale/procedurallib/logic/point/PointConsumer.java
package com.hypixel.hytale.procedurallib.logic.point;
public interface PointConsumer <T> {
void accept (double var1, double var3, T var5) ;
}
com/hypixel/hytale/procedurallib/logic/point/PointGenerator.java
package com.hypixel.hytale.procedurallib.logic.point;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class PointGenerator implements IPointGenerator {
protected final int seedOffset;
protected final CellDistanceFunction cellDistanceFunction;
protected final PointEvaluator pointEvaluator;
public PointGenerator (int seedOffset, CellDistanceFunction cellDistanceFunction, PointEvaluator pointEvaluator) {
this .seedOffset = seedOffset;
this .cellDistanceFunction = cellDistanceFunction;
this .pointEvaluator = pointEvaluator;
}
@Nonnull
protected ResultBuffer.Bounds2d localBounds2d () {
return ResultBuffer.bounds2d;
}
@Nonnull
protected ResultBuffer.ResultBuffer2d localBuffer2d () {
return ResultBuffer.buffer2d;
}
@Nonnull
protected ResultBuffer.ResultBuffer3d localBuffer3d () {
ResultBuffer.buffer3d;
}
ResultBuffer.ResultBuffer2d {
x = .cellDistanceFunction.scale(x);
y = .cellDistanceFunction.scale(y);
.cellDistanceFunction.getCellX(x, y);
.cellDistanceFunction.getCellY(x, y);
ResultBuffer. .localBuffer2d();
buffer.distance = / ;
.cellDistanceFunction.nearest2D(seed + .seedOffset, x, y, xr, yr, buffer, .pointEvaluator);
buffer;
}
ResultBuffer.ResultBuffer3d {
x = .cellDistanceFunction.scale(x);
y = .cellDistanceFunction.scale(y);
z = .cellDistanceFunction.scale(z);
.cellDistanceFunction.getCellX(x, y, z);
.cellDistanceFunction.getCellY(x, y, z);
.cellDistanceFunction.getCellZ(x, y, z);
ResultBuffer. .localBuffer3d();
buffer.distance = / ;
.cellDistanceFunction.nearest3D(seed + .seedOffset, x, y, z, xr, yr, zr, buffer, .pointEvaluator);
buffer;
}
ResultBuffer.ResultBuffer2d {
x = .cellDistanceFunction.scale(x);
y = .cellDistanceFunction.scale(y);
.cellDistanceFunction.getCellX(x, y);
.cellDistanceFunction.getCellY(x, y);
ResultBuffer. .localBuffer2d();
buffer.distance = / ;
buffer.distance2 = / ;
.cellDistanceFunction.transition2D(seed + .seedOffset, x, y, xr, yr, buffer, .pointEvaluator);
buffer;
}
ResultBuffer.ResultBuffer3d {
x = .cellDistanceFunction.scale(x);
y = .cellDistanceFunction.scale(y);
z = .cellDistanceFunction.scale(z);
.cellDistanceFunction.getCellX(x, y, z);
.cellDistanceFunction.getCellY(x, y, z);
.cellDistanceFunction.getCellZ(x, y, z);
ResultBuffer. .localBuffer3d();
buffer.distance = / ;
buffer.distance2 = / ;
.cellDistanceFunction.transition3D(seed + .seedOffset, x, y, z, xr, yr, zr, buffer, .pointEvaluator);
buffer;
}
{
;
}
{
.collect0(seed, minX, minY, maxX, maxY, (x, y, t) -> t.accept(x, y), consumer);
}
{
minX = .cellDistanceFunction.scale(minX);
minY = .cellDistanceFunction.scale(minY);
maxX = .cellDistanceFunction.scale(maxX);
maxY = .cellDistanceFunction.scale(maxY);
.cellDistanceFunction.getCellX(minX, minY);
.cellDistanceFunction.getCellY(minX, minY);
.cellDistanceFunction.getCellX(maxX, maxY);
.cellDistanceFunction.getCellY(maxX, maxY);
ResultBuffer. .localBounds2d();
bounds.assign(minX, minY, maxX, maxY);
.cellDistanceFunction.collect(seed, seed + .seedOffset, x0, y0, x1, y1, bounds, consumer, pointConsumer, .pointEvaluator);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(PointGenerator)o;
( .seedOffset != that.seedOffset) {
;
} {
! .cellDistanceFunction.equals(that.cellDistanceFunction) ? : .pointEvaluator.equals(that.pointEvaluator);
}
} {
;
}
}
{
.seedOffset;
result = * result + .cellDistanceFunction.hashCode();
result = * result + .pointEvaluator.hashCode();
result;
}
String {
.seedOffset;
+ var10000 + + String.valueOf( .cellDistanceFunction) + + String.valueOf( .pointEvaluator) + ;
}
}
com/hypixel/hytale/procedurallib/logic/point/ScaledPointGenerator.java
package com.hypixel.hytale.procedurallib.logic.point;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class ScaledPointGenerator implements IPointGenerator {
protected final PointGenerator pointGenerator;
protected final double scale;
public ScaledPointGenerator (PointGenerator pointGenerator, double scale) {
this .pointGenerator = pointGenerator;
this .scale = scale;
}
@Nonnull
public ResultBuffer.ResultBuffer2d nearest2D (int seed, double x, double y) {
ResultBuffer.ResultBuffer2d buf = this .pointGenerator.nearest2D(seed, x * this .scale, y * this .scale);
buf.x /= this .scale;
buf.y /= this .scale;
buf.distance = Math.sqrt(buf.distance) / this .scale;
return buf;
}
@Nonnull
public ResultBuffer.ResultBuffer3d nearest3D (int seed, double x, double y, z) {
ResultBuffer. .pointGenerator.nearest3D(seed, x * .scale, y * .scale, z * .scale);
buf.x /= .scale;
buf.y /= .scale;
buf.z /= .scale;
buf.distance = Math.sqrt(buf.distance) / .scale;
buf;
}
ResultBuffer.ResultBuffer2d {
ResultBuffer. .pointGenerator.transition2D(seed, x * .scale, y * .scale);
buf.x /= .scale;
buf.x2 /= .scale;
buf.y /= .scale;
buf.y2 /= .scale;
buf.distance = Math.sqrt(buf.distance) / .scale;
buf.distance2 = Math.sqrt(buf.distance2) / .scale;
buf;
}
ResultBuffer.ResultBuffer3d {
ResultBuffer. .pointGenerator.transition3D(seed, x * .scale, y * .scale, z * .scale);
buf.x /= .scale;
buf.x2 /= .scale;
buf.y /= .scale;
buf.y2 /= .scale;
buf.z /= .scale;
buf.z2 /= .scale;
buf.distance = Math.sqrt(buf.distance) / .scale;
buf.distance2 = Math.sqrt(buf.distance2) / .scale;
buf;
}
{
.pointGenerator.getInterval() / .scale;
}
{
minX *= .scale;
minY *= .scale;
maxX *= .scale;
maxY *= .scale;
.pointGenerator.collect0(seed, minX, minY, maxX, maxY, (x, y, t) -> t.accept(x / .scale, y / .scale), consumer);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(ScaledPointGenerator)o;
Double.compare(that.scale, .scale) != ? : .pointGenerator.equals(that.pointGenerator);
} {
;
}
}
{
.pointGenerator.hashCode();
Double.doubleToLongBits( .scale);
result = * result + ( )(temp ^ temp >>> );
result;
}
String {
String.valueOf( .pointGenerator);
+ var10000 + + .scale + ;
}
}
com/hypixel/hytale/procedurallib/property/BlendNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.math.util.MathUtil;
public class BlendNoiseProperty implements NoiseProperty {
private final NoiseProperty alpha;
private final NoiseProperty[] noises;
private final double [] thresholds;
private final transient double [] normalize;
public BlendNoiseProperty (NoiseProperty alpha, NoiseProperty[] noises, double [] thresholds) {
this .alpha = alpha;
this .noises = noises;
this .thresholds = thresholds;
this .normalize = new double [thresholds.length];
for (int i = 1 ; i < thresholds.length; ++i) {
if (thresholds[i] <= thresholds[i - 1 ]) {
throw new IllegalStateException ("Thresholds must be in ascending order" );
}
this .normalize[i] = 1.0 / (thresholds[i] - thresholds[i - 1 ]);
}
}
public double {
( .noises.length == ) {
;
} {
.alpha.get(seed, x, y);
(alpha <= .thresholds[ ]) {
.noises[ ].get(seed, x, y);
} (alpha >= .thresholds[ .thresholds.length - ]) {
.noises[ .noises.length - ].get(seed, x, y);
} {
( ; i < .noises.length; ++i) {
(alpha <= .thresholds[i]) {
(alpha - .thresholds[i - ]) * .normalize[i];
.noises[i - ].get(seed, x, y);
.noises[i].get(seed, x, y);
MathUtil.lerp(lower, upper, t);
}
}
;
}
}
}
{
( .noises.length == ) {
;
} {
.alpha.get(seed, x, y, z);
(alpha <= .thresholds[ ]) {
.noises[ ].get(seed, x, y, z);
} (alpha >= .thresholds[ .thresholds.length - ]) {
.noises[ .noises.length - ].get(seed, x, y, z);
} {
( ; i < .noises.length; ++i) {
(alpha <= .thresholds[i]) {
(alpha - .thresholds[i - ]) * .normalize[i];
.noises[i - ].get(seed, x, y, z);
.noises[i + ].get(seed, x, y, z);
MathUtil.lerp(lower, upper, t);
}
}
;
}
}
}
}
com/hypixel/hytale/procedurallib/property/CurveNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.math.util.MathUtil;
import java.util.function.DoubleUnaryOperator;
import javax.annotation.Nonnull;
public class CurveNoiseProperty implements NoiseProperty {
protected final NoiseProperty noise;
protected final DoubleUnaryOperator function;
public CurveNoiseProperty (NoiseProperty noise, DoubleUnaryOperator function) {
this .noise = noise;
this .function = function;
}
public double get (int seed, double x, double y) {
double value = this .noise.get(seed, x, y);
return this .function.applyAsDouble(value);
}
public double get (int seed, double x, double y, double z) {
double value = this .noise.get(seed, x, y, z);
return this .function.applyAsDouble(value);
}
@Nonnull
String {
String.valueOf( .noise);
+ var10000 + + String.valueOf( .function) + ;
}
{
;
a;
b;
{
.a = MathUtil.clamp(a, , );
.b = MathUtil.clamp(b, - .a, );
}
{
operand = - operand;
- Math.pow(operand, .a + .b * operand);
}
String {
+ .a + + .b + ;
}
}
}
com/hypixel/hytale/procedurallib/property/DistortedNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.procedurallib.random.ICoordinateRandomizer;
import javax.annotation.Nonnull;
public class DistortedNoiseProperty implements NoiseProperty {
protected final NoiseProperty noiseProperty;
protected final ICoordinateRandomizer randomizer;
public DistortedNoiseProperty (NoiseProperty noiseProperty, ICoordinateRandomizer randomizer) {
this .noiseProperty = noiseProperty;
this .randomizer = randomizer;
}
public NoiseProperty getNoiseProperty () {
return this .noiseProperty;
}
public ICoordinateRandomizer getRandomizer () {
return this .randomizer;
}
public double get (int seed, double x, double y) {
return this .noiseProperty.get(seed, this .randomizer.randomDoubleX(seed, x, y), this .randomizer.randomDoubleY(seed, x, y));
}
public double get (int seed, double x, y, z) {
.noiseProperty.get(seed, .randomizer.randomDoubleX(seed, x, y, z), .randomizer.randomDoubleY(seed, x, y, z), .randomizer.randomDoubleZ(seed, x, y, z));
}
String {
String.valueOf( .noiseProperty);
+ var10000 + + String.valueOf( .randomizer) + ;
}
}
com/hypixel/hytale/procedurallib/property/FractalNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.NoiseFunction2d;
import com.hypixel.hytale.procedurallib.NoiseFunction3d;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import javax.annotation.Nonnull;
public class FractalNoiseProperty implements NoiseProperty {
protected final int seedOffset;
protected final NoiseFunction function;
protected final FractalFunction fractalFunction;
protected final int octaves;
protected final double lacunarity;
protected final double persistence;
public FractalNoiseProperty (int seedOffset, NoiseFunction function, FractalFunction fractalFunction, int octaves, double lacunarity, double persistence) {
this .seedOffset = seedOffset;
this .function = function;
this .fractalFunction = fractalFunction;
this .octaves = octaves;
this .lacunarity = lacunarity;
this .persistence = persistence;
}
public int {
.seedOffset;
}
NoiseFunction {
.function;
}
FractalFunction {
.fractalFunction;
}
{
.octaves;
}
{
.lacunarity;
}
{
.persistence;
}
{
.fractalFunction.get(seed, seed + .seedOffset, x, y, .octaves, .lacunarity, .persistence, .function);
}
{
.fractalFunction.get(seed, seed + .seedOffset, x, y, z, .octaves, .lacunarity, .persistence, .function);
}
String {
.seedOffset;
+ var10000 + + String.valueOf( .function) + + String.valueOf( .fractalFunction) + + .octaves + + .lacunarity + + .persistence + ;
}
{
FBM( () {
{
noise.get(seed, offsetSeed, x, y);
;
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
amp *= persistence;
++offsetSeed;
sum += noise.get(seed, offsetSeed, x, y) * amp;
}
GeneralNoise.limit(sum * + );
}
{
noise.get(seed, offsetSeed, x, y, z);
;
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
z *= lacunarity;
amp *= persistence;
++offsetSeed;
sum += noise.get(seed, offsetSeed, x, y, z) * amp;
}
GeneralNoise.limit(sum * + );
}
String {
;
}
}),
BILLOW( () {
{
Math.abs(noise.get(seed, offsetSeed, x, y)) * - ;
;
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
amp *= persistence;
++offsetSeed;
sum += (Math.abs(noise.get(seed, offsetSeed, x, y)) * - ) * amp;
}
GeneralNoise.limit(sum * + );
}
{
Math.abs(noise.get(seed, offsetSeed, x, y, z)) * - ;
;
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
z *= lacunarity;
amp *= persistence;
++offsetSeed;
sum += (Math.abs(noise.get(seed, offsetSeed, x, y, z)) * - ) * amp;
}
GeneralNoise.limit(sum * + );
}
String {
;
}
}),
MULTI_RIGID( () {
{
- Math.abs(noise.get(seed, offsetSeed, x, y));
;
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
amp *= persistence;
++offsetSeed;
sum -= ( - Math.abs(noise.get(seed, offsetSeed, x, y))) * amp;
}
GeneralNoise.limit(sum * + );
}
{
- Math.abs(noise.get(seed, offsetSeed, x, y, z));
;
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
z *= lacunarity;
amp = ( )(( )amp * persistence);
++offsetSeed;
sum -= ( - Math.abs(noise.get(seed, offsetSeed, x, y, z))) * ( )amp;
}
GeneralNoise.limit(sum * + );
}
String {
;
}
}),
OLDSCHOOL( () {
{
;
;
;
;
--seed;
( ; i < octaves; ++i) {
sum += noise.get(seed, offsetSeed++, x * ( )freq, y * ( )freq) * amp;
maxAmp += amp;
amp *= persistence;
freq <<= ;
}
sum /= maxAmp;
sum *= ;
sum + ;
}
{
;
;
;
;
--seed;
( ; i < octaves; ++i) {
sum += noise.get(seed, offsetSeed++, x * ( )freq, y * ( )freq, z * ( )freq) * amp;
maxAmp += amp;
amp *= persistence;
freq <<= ;
}
sum /= maxAmp;
sum *= ;
sum + ;
}
String {
;
}
}),
MIN( () {
{
noise.get(seed, offsetSeed, x, y);
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
++offsetSeed;
noise.get(seed, offsetSeed, x, y);
(d < min) {
min = d;
}
}
GeneralNoise.limit(min * + );
}
{
noise.get(seed, offsetSeed, x, y, z);
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
++offsetSeed;
noise.get(seed, offsetSeed, x, y, z);
(d < min) {
min = d;
}
}
GeneralNoise.limit(min * + );
}
String {
;
}
}),
MAX( () {
{
noise.get(seed, offsetSeed, x, y);
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
++offsetSeed;
noise.get(seed, offsetSeed, x, y);
(d > max) {
max = d;
}
}
GeneralNoise.limit(max * + );
}
{
noise.get(seed, offsetSeed, x, y, z);
( ; i < octaves; ++i) {
x *= lacunarity;
y *= lacunarity;
++offsetSeed;
noise.get(seed, offsetSeed, x, y, z);
(d > max) {
max = d;
}
}
GeneralNoise.limit(max * + );
}
String {
;
}
});
FractalFunction function;
{
.function = function;
}
FractalFunction {
.function;
}
}
{
;
;
}
}
com/hypixel/hytale/procedurallib/property/GradientNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
public class GradientNoiseProperty implements NoiseProperty {
protected final NoiseProperty noise;
protected final GradientMode mode;
protected final double distance;
protected final double invNormalize;
public GradientNoiseProperty (NoiseProperty noise, GradientMode mode, double distance, double normalize) {
this .noise = noise;
this .mode = mode;
this .distance = distance;
this .invNormalize = 1.0 / distance / normalize;
}
public double get (int seed, double x, double y) {
double v = this .noise.get(seed, x, y);
double s = this .noise.get(seed, x, y + this .distance);
double e .noise.get(seed, x + .distance, y);
e - v;
s - v;
var10000;
( .mode.ordinal()) {
-> var10000 = getMagnitude(dx, dy, .invNormalize);
-> var10000 = getAngle(dx, dy);
-> var10000 = getAbsAngle(dx, dy);
-> ((String) , (Throwable) );
}
var10000;
}
{
();
}
{
TrigMathUtil.atan2(dy, dx);
angle = (angle + ) / ;
( )convertRange(angle);
}
{
TrigMathUtil.atan2(dy, dx);
( )(Math.abs(angle) / );
}
{
MathUtil.length(dx, dy);
MathUtil.clamp(mag * invNormalize, , );
}
{
angle += ;
angle > ? angle - : angle;
}
{
MAGNITUDE,
ANGLE,
ANGLE_ABS;
{
}
}
}
com/hypixel/hytale/procedurallib/property/InvertNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
public class InvertNoiseProperty implements NoiseProperty {
protected final NoiseProperty noiseProperty;
public InvertNoiseProperty (NoiseProperty noiseProperty) {
this .noiseProperty = noiseProperty;
}
public double get (int seed, double x, double y) {
return 1.0 - this .noiseProperty.get(seed, x, y);
}
public double get (int seed, double x, double y, double z) {
return 1.0 - this .noiseProperty.get(seed, x, y, z);
}
}
com/hypixel/hytale/procedurallib/property/MaxNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class MaxNoiseProperty implements NoiseProperty {
public static final double MAX_EPSILON = 0.999999 ;
protected final NoiseProperty[] noiseProperties;
public MaxNoiseProperty (NoiseProperty[] noiseProperties) {
this .noiseProperties = noiseProperties;
}
public NoiseProperty[] getNoiseProperties() {
return this .noiseProperties;
}
public double get (int seed, double x, double y) {
double val = this .noiseProperties[0 ].get(seed, x, y);
for (int i = 1 ; i < this .noiseProperties.length; ++i) {
if (val > 0.999999 ) {
return 1.0 ;
}
double d;
(val < (d = .noiseProperties[i].get(seed, x, y))) {
val = d;
}
}
val;
}
{
.noiseProperties[ ].get(seed, x, y, z);
( ; i < .noiseProperties.length; ++i) {
(val > ) {
;
}
d;
(val < (d = .noiseProperties[i].get(seed, x, y, z))) {
val = d;
}
}
val;
}
String {
+ Arrays.toString( .noiseProperties) + ;
}
}
com/hypixel/hytale/procedurallib/property/MinNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class MinNoiseProperty implements NoiseProperty {
public static final double MIN_EPSILON = 1.0E-5 ;
protected final NoiseProperty[] noiseProperties;
public MinNoiseProperty (NoiseProperty[] noiseProperties) {
this .noiseProperties = noiseProperties;
}
public NoiseProperty[] getNoiseProperties() {
return this .noiseProperties;
}
public double get (int seed, double x, double y) {
double val = this .noiseProperties[0 ].get(seed, x, y);
for (int i = 1 ; i < this .noiseProperties.length; ++i) {
if (val < 1.0E-5 ) {
return 0.0 ;
}
double d;
(val > (d = .noiseProperties[i].get(seed, x, y))) {
val = d;
}
}
val;
}
{
.noiseProperties[ ].get(seed, x, y, z);
( ; i < .noiseProperties.length; ++i) {
(val < ) {
;
}
d;
(val > (d = .noiseProperties[i].get(seed, x, y, z))) {
val = d;
}
}
val;
}
String {
+ Arrays.toString( .noiseProperties) + ;
}
}
com/hypixel/hytale/procedurallib/property/MultiplyNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class MultiplyNoiseProperty implements NoiseProperty {
protected final NoiseProperty[] noiseProperties;
public MultiplyNoiseProperty (NoiseProperty[] noiseProperties) {
this .noiseProperties = noiseProperties;
}
public NoiseProperty[] getNoiseProperties() {
return this .noiseProperties;
}
public double get (int seed, double x, double y) {
double val = this .noiseProperties[0 ].get(seed, x, y);
for (int i = 1 ; i < this .noiseProperties.length; ++i) {
val *= this .noiseProperties[i].get(seed, x, y);
}
return val;
}
public double get (int seed, double x, double y, double z) {
double val .noiseProperties[ ].get(seed, x, y, z);
( ; i < .noiseProperties.length; ++i) {
val *= .noiseProperties[i].get(seed, x, y, z);
}
val;
}
String {
+ Arrays.toString( .noiseProperties) + ;
}
}
package com.hypixel.hytale.procedurallib.property;
import javax.annotation.Nonnull;
public class NoiseFormulaProperty implements NoiseProperty {
protected final NoiseProperty property;
protected final NoiseFormula.Formula formula;
public NoiseFormulaProperty (NoiseProperty property, NoiseFormula.Formula formula) {
this .property = property;
this .formula = formula;
}
public NoiseProperty getProperty () {
return this .property;
}
public NoiseFormula.Formula getFormula () {
return this .formula;
}
public double get (int seed, double x, double y) {
return this .formula.eval(this .property.get(seed, x, y));
}
public double get (int seed, double x, double y, double z) {
return this .formula.eval(this .property.get(seed, x, y, z));
}
String {
String.valueOf( .property);
+ var10000 + + String.valueOf( .formula) + ;
}
{
NORMAL( () {
{
noise;
}
String {
;
}
}),
INVERTED( () {
{
- noise;
}
String {
;
}
}),
SQUARED( () {
{
noise * noise;
}
String {
;
}
}),
INVERTED_SQUARED( () {
{
- noise * noise;
}
String {
;
}
}),
SQRT( () {
{
Math.sqrt(noise);
}
String {
;
}
}),
INVERTED_SQRT( () {
{
- Math.sqrt(noise);
}
String {
;
}
}),
RIDGED( () {
{
Math.abs(noise - );
}
String {
;
}
}),
INVERTED_RIDGED( () {
{
- Math.abs(noise - );
}
String {
;
}
}),
RIDGED_SQRT( () {
{
Math.sqrt(Math.abs(noise - ));
}
String {
;
}
}),
INVERTED_RIDGED_SQRT( () {
{
- Math.sqrt(Math.abs(noise - ));
}
String {
;
}
}),
RIDGED_FIX( () {
{
Math.abs(noise * - );
}
String {
;
}
}),
INVERTED_RIDGED_FIX( () {
{
- Math.abs(noise * - );
}
String {
;
}
}),
RIDGED_SQRT_FIX( () {
{
Math.sqrt(Math.abs(noise * - ));
}
String {
;
}
}),
INVERTED_RIDGED_SQRT_FIX( () {
{
- Math.sqrt(Math.abs(noise * - ));
}
String {
;
}
}),
RIDGED_SQUARED_FIX( () {
{
noise = Math.abs(noise * - );
noise * noise;
}
String {
;
}
}),
INVERTED_RIDGED_SQUARED_FIX( () {
{
noise = Math.abs(noise * - );
- noise * noise;
}
String {
;
}
});
Formula formula;
{
.formula = formula;
}
Formula {
.formula;
}
{
;
}
}
}
com/hypixel/hytale/procedurallib/property/NoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
public interface NoiseProperty {
double get (int var1, double var2, double var4) ;
double get (int var1, double var2, double var4, double var6) ;
}
com/hypixel/hytale/procedurallib/property/NoisePropertyType.java
package com.hypixel.hytale.procedurallib.property;
public enum NoisePropertyType {
DISTORTED,
MAX,
MIN,
MULTIPLY,
NORMALIZE,
FORMULA,
SCALE,
SUM,
INVERT,
OFFSET,
ROTATE,
GRADIENT,
CURVE,
BLEND;
private NoisePropertyType () {
}
}
com/hypixel/hytale/procedurallib/property/NormalizeNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import javax.annotation.Nonnull;
public class NormalizeNoiseProperty implements NoiseProperty {
protected final NoiseProperty noiseProperty;
protected final double min;
protected final double range;
public NormalizeNoiseProperty (NoiseProperty noiseProperty, double min, double range) {
this .noiseProperty = noiseProperty;
this .min = min;
this .range = range;
}
public NoiseProperty getNoiseProperty () {
return this .noiseProperty;
}
public double getMin () {
return this .min;
}
public double getRange () {
return this .range;
}
public double get (int seed, double x, y) {
GeneralNoise.limit(( .noiseProperty.get(seed, x, y) - .min) / .range);
}
{
GeneralNoise.limit(( .noiseProperty.get(seed, x, y, z) - .min) / .range);
}
String {
String.valueOf( .noiseProperty);
+ var10000 + + .min + + .range + ;
}
}
com/hypixel/hytale/procedurallib/property/OffsetNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import javax.annotation.Nonnull;
public class OffsetNoiseProperty implements NoiseProperty {
protected final NoiseProperty noiseProperty;
protected final double offsetX;
protected final double offsetY;
protected final double offsetZ;
public OffsetNoiseProperty (NoiseProperty noiseProperty, double offset) {
this (noiseProperty, offset, offset, offset);
}
public OffsetNoiseProperty (NoiseProperty noiseProperty, double offsetX, double offsetY, double offsetZ) {
this .noiseProperty = noiseProperty;
this .offsetX = offsetX;
this .offsetY = offsetY;
this .offsetZ = offsetZ;
}
public NoiseProperty getNoiseProperty () {
return this .noiseProperty;
}
public double getOffsetX () {
return this .offsetX;
}
public {
.offsetY;
}
{
.offsetZ;
}
{
.noiseProperty.get(seed, x + .offsetX, y + .offsetY);
}
{
.noiseProperty.get(seed, x + .offsetX, y + .offsetY, z + .offsetZ);
}
String {
String.valueOf( .noiseProperty);
+ var10000 + + .offsetX + + .offsetY + + .offsetZ + ;
}
}
com/hypixel/hytale/procedurallib/property/RotateNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.procedurallib.random.CoordinateRotator;
import javax.annotation.Nonnull;
public class RotateNoiseProperty implements NoiseProperty {
protected final NoiseProperty noise;
protected final CoordinateRotator rotation;
public RotateNoiseProperty (NoiseProperty noise, CoordinateRotator rotation) {
this .noise = noise;
this .rotation = rotation;
}
public double get (int seed, double x, double y) {
double px = this .rotation.rotateX(x, y);
double py = this .rotation.rotateY(x, y);
return this .noise.get(seed, px, py);
}
public double get (int seed, double x, double y, double z) {
double px = this .rotation.rotateX(x, y, z);
double .rotation.rotateY(x, y, z);
.rotation.rotateZ(x, y, z);
.noise.get(seed, px, py, pz);
}
String {
String.valueOf( .noise);
+ var10000 + + String.valueOf( .rotation) + ;
}
}
com/hypixel/hytale/procedurallib/property/ScaleNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import javax.annotation.Nonnull;
public class ScaleNoiseProperty implements NoiseProperty {
protected final NoiseProperty noiseProperty;
protected final double scaleX;
protected final double scaleY;
protected final double scaleZ;
public ScaleNoiseProperty (NoiseProperty noiseProperty, double scale) {
this (noiseProperty, scale, scale, scale);
}
public ScaleNoiseProperty (NoiseProperty noiseProperty, double scaleX, double scaleY, double scaleZ) {
this .noiseProperty = noiseProperty;
this .scaleX = scaleX;
this .scaleY = scaleY;
this .scaleZ = scaleZ;
}
public NoiseProperty getNoiseProperty () {
return this .noiseProperty;
}
public double getScaleX () {
return this .scaleX;
}
public {
.scaleY;
}
{
.scaleZ;
}
{
.noiseProperty.get(seed, x * .scaleX, y * .scaleY);
}
{
.noiseProperty.get(seed, x * .scaleX, y * .scaleY, z * .scaleZ);
}
String {
String.valueOf( .noiseProperty);
+ var10000 + + .scaleX + + .scaleY + + .scaleZ + ;
}
}
com/hypixel/hytale/procedurallib/property/SingleNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.procedurallib.NoiseFunction;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import javax.annotation.Nonnull;
public class SingleNoiseProperty implements NoiseProperty {
protected final int seedOffset;
protected final NoiseFunction function;
public SingleNoiseProperty (NoiseFunction function) {
this (0 , function);
}
public SingleNoiseProperty (int seedOffset, NoiseFunction function) {
this .seedOffset = seedOffset;
this .function = function;
}
public int getSeedOffset () {
return this .seedOffset;
}
public NoiseFunction getFunction () {
return this .function;
}
public double get (int seed, double x, double y) {
return GeneralNoise.limit(this .function.get(seed, seed + .seedOffset, x, y) * + );
}
{
GeneralNoise.limit( .function.get(seed, seed + .seedOffset, x, y, z) * + );
}
String {
.seedOffset;
+ var10000 + + String.valueOf( .function) + ;
}
}
com/hypixel/hytale/procedurallib/property/SumNoiseProperty.java
package com.hypixel.hytale.procedurallib.property;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class SumNoiseProperty implements NoiseProperty {
protected final Entry[] entries;
public SumNoiseProperty (Entry[] entries) {
this .entries = entries;
}
public Entry[] getEntries() {
return this .entries;
}
public double get (int seed, double x, double y) {
double val = 0.0 ;
for (Entry entry : this .entries) {
val += entry.noiseProperty.get(seed, x, y) * entry.factor;
}
return GeneralNoise.limit(val);
}
public double get (int seed, double x, double y, double z) {
double val = 0.0 ;
for (Entry entry : this .entries) {
val += entry.noiseProperty.get(seed, x, y, z) * entry.factor;
}
GeneralNoise.limit(val);
}
String {
+ Arrays.toString( .entries) + ;
}
{
NoiseProperty noiseProperty;
factor;
{
.noiseProperty = noiseProperty;
.factor = factor;
}
NoiseProperty {
.noiseProperty;
}
{
.noiseProperty = noiseProperty;
}
{
.factor;
}
{
.factor = factor;
}
String {
String.valueOf( .noiseProperty);
+ var10000 + + .factor + ;
}
}
}
com/hypixel/hytale/procedurallib/random/CoordinateOriginRotator.java
package com.hypixel.hytale.procedurallib.random;
import javax.annotation.Nonnull;
public class CoordinateOriginRotator extends CoordinateRotator {
private final double originX;
private final double originY;
private final double originZ;
public CoordinateOriginRotator (double pitch, double yaw, double originX, double originY, double originZ) {
super (pitch, yaw);
this .originX = originX;
this .originY = originY;
this .originZ = originZ;
}
public double randomDoubleX (int seed, double x, double y) {
x -= this .originX;
y -= this .originY;
return this .originX + this .rotateX(x, y);
}
public double randomDoubleY (int seed, double x, double y) {
x -= this .originX;
y -= .originY;
.originY + .rotateY(x, y);
}
{
x -= .originX;
y -= .originY;
z -= .originZ;
.originX + .rotateX(x, y, z);
}
{
x -= .originX;
y -= .originY;
z -= .originZ;
.originY + .rotateY(x, y, z);
}
{
x -= .originX;
y -= .originY;
z -= .originZ;
.originZ + .rotateZ(x, y, z);
}
String {
+ .pitch + + .yaw + + .originX + + .originY + + .originZ + ;
}
}
com/hypixel/hytale/procedurallib/random/CoordinateRandomizer.java
package com.hypixel.hytale.procedurallib.random;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class CoordinateRandomizer implements ICoordinateRandomizer {
public static final ICoordinateRandomizer EMPTY_RANDOMIZER = new EmptyCoordinateRandomizer ();
protected final AmplitudeNoiseProperty[] xNoise;
protected final AmplitudeNoiseProperty[] yNoise;
protected final AmplitudeNoiseProperty[] zNoise;
public CoordinateRandomizer (AmplitudeNoiseProperty[] xNoise, AmplitudeNoiseProperty[] yNoise, AmplitudeNoiseProperty[] zNoise) {
this .xNoise = xNoise;
this .yNoise = yNoise;
this .zNoise = zNoise;
}
public AmplitudeNoiseProperty[] getXNoise() {
return this .xNoise;
}
public AmplitudeNoiseProperty[] getYNoise() {
return this .yNoise;
}
public AmplitudeNoiseProperty[] getZNoise() {
return this .zNoise;
}
public double randomDoubleX {
;
(AmplitudeNoiseProperty property : .xNoise) {
offsetX += (property.property.get(seed, x, y) * - ) * property.amplitude;
}
x + offsetX;
}
{
;
(AmplitudeNoiseProperty property : .yNoise) {
offsetY += (property.property.get(seed, x, y) * - ) * property.amplitude;
}
y + offsetY;
}
{
;
(AmplitudeNoiseProperty property : .xNoise) {
offsetX += (property.property.get(seed, x, y, z) * - ) * property.amplitude;
}
x + offsetX;
}
{
;
(AmplitudeNoiseProperty property : .yNoise) {
offsetY += (property.property.get(seed, x, y, z) * - ) * property.amplitude;
}
y + offsetY;
}
{
;
(AmplitudeNoiseProperty property : .zNoise) {
offsetZ += (property.property.get(seed, x, y, z) * - ) * property.amplitude;
}
z + offsetZ;
}
String {
Arrays.toString( .xNoise);
+ var10000 + + Arrays.toString( .yNoise) + + Arrays.toString( .zNoise) + ;
}
{
NoiseProperty property;
amplitude;
{
.property = property;
.amplitude = amplitude;
}
NoiseProperty {
.property;
}
{
.property = property;
}
{
.amplitude;
}
{
.amplitude = amplitude;
}
String {
String.valueOf( .property);
+ var10000 + + .amplitude + ;
}
}
{
{
}
{
x;
}
{
y;
}
{
x;
}
{
y;
}
{
z;
}
String {
;
}
}
}
com/hypixel/hytale/procedurallib/random/CoordinateRotator.java
package com.hypixel.hytale.procedurallib.random;
import com.hypixel.hytale.math.util.TrigMathUtil;
import javax.annotation.Nonnull;
public class CoordinateRotator implements ICoordinateRandomizer {
public static final CoordinateRotator NONE = new CoordinateRotator (0.0 , 0.0 );
public static final int X0 = 0 ;
public static final int Y0 = 1 ;
public static final int Z0 = 2 ;
public static final int X1 = 3 ;
public static final int Y1 = 4 ;
;
;
;
;
pitch;
yaw;
[] matrix;
{
.pitch = pitch;
.yaw = yaw;
.matrix = createRotationMatrix(pitch, yaw);
}
{
x * .matrix[ ] + y * .matrix[ ];
}
{
x * .matrix[ ] + y * .matrix[ ];
}
{
x * .matrix[ ] + y * .matrix[ ] + z * .matrix[ ];
}
{
x * .matrix[ ] + y * .matrix[ ] + z * .matrix[ ];
}
{
x * .matrix[ ] + y * .matrix[ ] + z * .matrix[ ];
}
{
.rotateX(x, y);
}
{
.rotateY(x, y);
}
{
.rotateX(x, y, z);
}
{
.rotateY(x, y, z);
}
{
.rotateZ(x, y, z);
}
String {
+ .pitch + + .yaw + ;
}
[] createRotationMatrix( pitch, yaw) {
( )TrigMathUtil.sin(yaw);
( )TrigMathUtil.cos(yaw);
( )TrigMathUtil.sin(pitch);
( )TrigMathUtil.cos(pitch);
;
;
;
;
-sinPitch;
;
;
;
;
;
-sinYaw;
;
[]{dot(px1, px2, px3, cosYaw, yy1, yz1), dot(px1, px2, px3, yx2, yy2, yz2), dot(px1, px2, px3, sinYaw, yy3, cosYaw), dot(py1, cosPitch, py3, cosYaw, yy1, yz1), dot(py1, cosPitch, py3, yx2, yy2, yz2), dot(py1, cosPitch, py3, sinYaw, yy3, cosYaw), dot(pz1, sinPitch, cosPitch, cosYaw, yy1, yz1), dot(pz1, sinPitch, cosPitch, yx2, yy2, yz2), dot(pz1, sinPitch, cosPitch, sinYaw, yy3, cosYaw)};
}
{
x1 * x2 + y1 * y2 + z1 * z2;
}
}
com/hypixel/hytale/procedurallib/random/ICoordinateRandomizer.java
package com.hypixel.hytale.procedurallib.random;
public interface ICoordinateRandomizer {
double randomDoubleX (int var1, double var2, double var4) ;
double randomDoubleY (int var1, double var2, double var4) ;
double randomDoubleX (int var1, double var2, double var4, double var6) ;
double randomDoubleY (int var1, double var2, double var4, double var6) ;
double randomDoubleZ (int var1, double var2, double var4, double var6) ;
}
com/hypixel/hytale/procedurallib/random/RotatedCoordinateRandomizer.java
package com.hypixel.hytale.procedurallib.random;
import javax.annotation.Nonnull;
public class RotatedCoordinateRandomizer implements ICoordinateRandomizer {
protected final ICoordinateRandomizer randomizer;
protected final CoordinateRotator rotation;
public RotatedCoordinateRandomizer (ICoordinateRandomizer randomizer, CoordinateRotator rotation) {
this .randomizer = randomizer;
this .rotation = rotation;
}
public double randomDoubleX (int seed, double x, double y) {
double px = this .rotation.rotateX(x, y);
double py = this .rotation.rotateY(x, y);
return this .randomizer.randomDoubleX(seed, px, py);
}
public double randomDoubleY (int seed, double x, double y) {
double px = this .rotation.rotateX(x, y);
double py = .rotation.rotateY(x, y);
.randomizer.randomDoubleY(seed, px, py);
}
{
.rotation.rotateX(x, y, z);
.rotation.rotateY(x, y, z);
.rotation.rotateZ(x, y, z);
.randomizer.randomDoubleX(seed, px, py, pz);
}
{
.rotation.rotateX(x, y, z);
.rotation.rotateY(x, y, z);
.rotation.rotateZ(x, y, z);
.randomizer.randomDoubleY(seed, px, py, pz);
}
{
.rotation.rotateX(x, y, z);
.rotation.rotateY(x, y, z);
.rotation.rotateZ(x, y, z);
.randomizer.randomDoubleZ(seed, px, py, pz);
}
String {
String.valueOf( .randomizer);
+ var10000 + + String.valueOf( .rotation) + ;
}
}
com/hypixel/hytale/procedurallib/supplier/ConstantDoubleCoordinateHashSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
import javax.annotation.Nonnull;
public class ConstantDoubleCoordinateHashSupplier implements IDoubleCoordinateHashSupplier {
public static final ConstantDoubleCoordinateHashSupplier ZERO = new ConstantDoubleCoordinateHashSupplier (0.0 );
public static final ConstantDoubleCoordinateHashSupplier ONE = new ConstantDoubleCoordinateHashSupplier (1.0 );
protected final double result;
public ConstantDoubleCoordinateHashSupplier (double result) {
this .result = result;
}
public double getResult () {
return this .result;
}
public double get (int seed, int x, int y, long hash) {
return this .result;
}
String {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/supplier/ConstantFloatCoordinateHashSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
import javax.annotation.Nonnull;
public class ConstantFloatCoordinateHashSupplier implements IFloatCoordinateHashSupplier {
public static final ConstantFloatCoordinateHashSupplier ZERO = new ConstantFloatCoordinateHashSupplier (0.0F );
public static final ConstantFloatCoordinateHashSupplier ONE = new ConstantFloatCoordinateHashSupplier (1.0F );
protected final float result;
public ConstantFloatCoordinateHashSupplier (float result) {
this .result = result;
}
public float getResult () {
return this .result;
}
public float get (int seed, double x, double y, long hash) {
return this .result;
}
String {
+ .result + ;
}
}
com/hypixel/hytale/procedurallib/supplier/DoubleRange.java
package com.hypixel.hytale.procedurallib.supplier;
import java.util.Arrays;
import java.util.Random;
import java.util.function.DoubleSupplier;
import javax.annotation.Nonnull;
public class DoubleRange {
public static final Constant ZERO = new Constant (0.0 );
public static final Constant ONE = new Constant (1.0 );
public DoubleRange () {
}
public static class Constant implements IDoubleRange {
protected final double result;
public Constant (double result) {
this .result = result;
}
public double getResult () {
return this .result;
}
{
.result;
}
{
.result;
}
{
.result;
}
{
.result;
}
{
.result;
}
String {
+ .result + ;
}
}
{
min;
range;
{
.min = min;
.range = max - min;
}
{
.min;
}
{
.range;
}
{
.min + .range * v;
}
{
.min + .range * supplier.getAsDouble();
}
{
.getValue(random.nextDouble());
}
{
.min + .range * supplier.get(seed, x, y);
}
{
.min + .range * supplier.get(seed, x, y, z);
}
String {
+ .min + + .range + ;
}
}
{
[] thresholds;
[] values;
{
.thresholds = thresholds;
.values = values;
}
{
(v > .thresholds[ .thresholds.length - ]) {
.values[ .values.length - ];
} {
;
( ; i < .thresholds.length; ++i) {
.thresholds[i];
(v < max) {
(i == ) {
.values[ ];
}
(v - min) / (max - min);
.values[i - ];
.values[i];
valueMax - valueMin;
valueMin + alpha * range;
}
min = max;
}
;
}
}
{
.getValue(supplier.getAsDouble());
}
{
.getValue(random.nextDouble());
}
{
.getValue(supplier.get(seed, x, y));
}
{
.getValue(supplier.get(seed, x, y, z));
}
String {
Arrays.toString( .thresholds);
+ var10000 + + Arrays.toString( .values) + ;
}
}
}
com/hypixel/hytale/procedurallib/supplier/DoubleRangeCoordinateHashSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
import com.hypixel.hytale.math.util.HashUtil;
import javax.annotation.Nonnull;
public class DoubleRangeCoordinateHashSupplier implements IDoubleCoordinateHashSupplier {
protected final IDoubleRange range;
public DoubleRangeCoordinateHashSupplier (IDoubleRange range) {
this .range = range;
}
public double get (int seed, int x, int y, long hash) {
return this .range.getValue(HashUtil.random((long )seed, (long )x, (long )y, hash));
}
@Nonnull
public String toString () {
return "DoubleRangeCoordinateHashSupplier{range=" + String.valueOf(this .range) + "}" ;
}
}
com/hypixel/hytale/procedurallib/supplier/DoubleRangeNoiseSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.util.Objects;
import javax.annotation.Nonnull;
public class DoubleRangeNoiseSupplier implements IDoubleCoordinateSupplier {
protected final IDoubleRange range;
@Nonnull
protected final NoiseProperty noiseProperty;
@Nonnull
protected final IDoubleCoordinateSupplier2d supplier2d;
@Nonnull
protected final IDoubleCoordinateSupplier3d supplier3d;
public DoubleRangeNoiseSupplier (IDoubleRange range, @Nonnull NoiseProperty noiseProperty) {
this .range = range;
this .noiseProperty = noiseProperty;
Objects.requireNonNull(noiseProperty);
this .supplier2d = noiseProperty::get;
Objects.requireNonNull(noiseProperty);
this .supplier3d = noiseProperty::get;
}
public double get (int seed, double x, double y) {
return this .range.getValue(seed, x, y, this .supplier2d);
}
public double get ( seed, x, y, z) {
.range.getValue(seed, x, y, z, .supplier3d);
}
String {
String.valueOf( .range);
+ var10000 + + String.valueOf( .noiseProperty) + ;
}
}
com/hypixel/hytale/procedurallib/supplier/FloatRange.java
package com.hypixel.hytale.procedurallib.supplier;
import java.util.Random;
import javax.annotation.Nonnull;
public class FloatRange {
public static final Constant ZERO = new Constant (0.0F );
public static final Constant ONE = new Constant (1.0F );
public FloatRange () {
}
public static class Constant implements IFloatRange {
protected final float result;
public Constant (float result) {
this .result = result;
}
public float getResult () {
return this .result;
}
public float getValue {
.result;
}
{
.result;
}
{
.result;
}
{
.result;
}
{
.result;
}
String {
+ .result + ;
}
}
{
min;
range;
{
.min = min;
.range = max - min;
}
{
.min;
}
{
.range;
}
{
.min + .range * v;
}
{
.min + .range * supplier.getAsFloat();
}
{
.getValue(random.nextFloat());
}
{
.min + .range * ( )supplier.get(seed, x, y);
}
{
.min + .range * ( )supplier.get(seed, x, y, z);
}
String {
+ .min + + .range + ;
}
}
}
com/hypixel/hytale/procedurallib/supplier/FloatRangeNoiseSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import java.util.Objects;
import javax.annotation.Nonnull;
public class FloatRangeNoiseSupplier implements IFloatCoordinateSupplier {
protected final IFloatRange range;
@Nonnull
protected final NoiseProperty noiseProperty;
@Nonnull
protected final IDoubleCoordinateSupplier2d supplier2d;
@Nonnull
protected final IDoubleCoordinateSupplier3d supplier3d;
public FloatRangeNoiseSupplier (IFloatRange range, @Nonnull NoiseProperty noiseProperty) {
this .range = range;
this .noiseProperty = noiseProperty;
Objects.requireNonNull(noiseProperty);
this .supplier2d = noiseProperty::get;
Objects.requireNonNull(noiseProperty);
this .supplier3d = noiseProperty::get;
}
public float get (int seed, double x, double y) {
return this .range.getValue(seed, x, y, this .supplier2d);
}
public float get ( seed, x, y, z) {
.range.getValue(seed, x, y, z, .supplier3d);
}
String {
String.valueOf( .range);
+ var10000 + + String.valueOf( .noiseProperty) + ;
}
}
com/hypixel/hytale/procedurallib/supplier/FloatSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
@FunctionalInterface
public interface FloatSupplier {
float getAsFloat () ;
}
com/hypixel/hytale/procedurallib/supplier/IDoubleCoordinateHashSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
public interface IDoubleCoordinateHashSupplier {
double get (int var1, int var2, int var3, long var4) ;
}
com/hypixel/hytale/procedurallib/supplier/IDoubleCoordinateSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
public interface IDoubleCoordinateSupplier {
double get (int var1, double var2, double var4) ;
double get (int var1, double var2, double var4, double var6) ;
}
com/hypixel/hytale/procedurallib/supplier/IDoubleCoordinateSupplier2d.java
package com.hypixel.hytale.procedurallib.supplier;
public interface IDoubleCoordinateSupplier2d {
double get (int var1, double var2, double var4) ;
}
com/hypixel/hytale/procedurallib/supplier/IDoubleCoordinateSupplier3d.java
package com.hypixel.hytale.procedurallib.supplier;
public interface IDoubleCoordinateSupplier3d {
double get (int var1, double var2, double var4, double var6) ;
}
com/hypixel/hytale/procedurallib/supplier/IDoubleRange.java
package com.hypixel.hytale.procedurallib.supplier;
import java.util.Random;
import java.util.function.DoubleSupplier;
public interface IDoubleRange {
double getValue (double var1) ;
double getValue (DoubleSupplier var1) ;
double getValue (Random var1) ;
double getValue (int var1, double var2, double var4, IDoubleCoordinateSupplier2d var6) ;
double getValue (int var1, double var2, double var4, double var6, IDoubleCoordinateSupplier3d var8) ;
}
com/hypixel/hytale/procedurallib/supplier/IFloatCoordinateHashSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
public interface IFloatCoordinateHashSupplier {
float get (int var1, double var2, double var4, long var6) ;
}
com/hypixel/hytale/procedurallib/supplier/IFloatCoordinateSupplier.java
package com.hypixel.hytale.procedurallib.supplier;
public interface IFloatCoordinateSupplier {
float get (int var1, double var2, double var4) ;
float get (int var1, double var2, double var4, double var6) ;
}
com/hypixel/hytale/procedurallib/supplier/IFloatRange.java
package com.hypixel.hytale.procedurallib.supplier;
import java.util.Random;
public interface IFloatRange {
float getValue (float var1) ;
float getValue (FloatSupplier var1) ;
float getValue (Random var1) ;
float getValue (int var1, double var2, double var4, IDoubleCoordinateSupplier2d var6) ;
float getValue (int var1, double var2, double var4, double var6, IDoubleCoordinateSupplier3d var8) ;
}
com/hypixel/hytale/procedurallib/supplier/ISeedDoubleRange.java
package com.hypixel.hytale.procedurallib.supplier;
@FunctionalInterface
public interface ISeedDoubleRange {
ISeedDoubleRange DIRECT = (seed, value) -> value;
double getValue (int var1, double var2) ;
}
com/hypixel/hytale/procedurallib/util/IntToIntFunction.java
package com.hypixel.hytale.procedurallib.util;
@FunctionalInterface
public interface IntToIntFunction {
int applyAsInt (int var1) ;
}