Constants interface

Пакет: com.hypixel.hytale.procedurallib.json

Файл: com/hypixel/hytale/procedurallib/json/CellNoiseJsonLoader.java

Поля (19)

МодификаторыТипИмя
CellNoise.CellMode DEFAULT_CELL_MODE
CellType DEFAULT_CELL_TYPE
double DEFAULT_DENSITY_LOWER
double DEFAULT_DENSITY_UPPER
DistanceCalculationMode DEFAULT_DISTANCE_MODE
double DEFAULT_DISTANCE_RANGE
double DEFAULT_JITTER
String KEY_CELL_MODE
String KEY_CELL_TYPE
String KEY_DENSITY
String KEY_DISTANCE_MODE
String KEY_DISTANCE_RANGE
String KEY_JITTER
String KEY_JITTER_X
String KEY_JITTER_Y
String KEY_JITTER_Z
String KEY_NOISE_LOOKUP
String KEY_SKIP_CELLS
String KEY_SKIP_MODE

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.procedurallib.json;

class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.procedurallib.NoiseFunction;
class="kw">import com.hypixel.hytale.procedurallib.logic.CellNoise;
class="kw">import com.hypixel.hytale.procedurallib.logic.ResultBuffer;
class="kw">import com.hypixel.hytale.procedurallib.logic.cell.CellDistanceFunction;
class="kw">import com.hypixel.hytale.procedurallib.logic.cell.CellType;
class="kw">import com.hypixel.hytale.procedurallib.logic.cell.DistanceCalculationMode;
class="kw">import com.hypixel.hytale.procedurallib.logic.cell.evaluator.PointEvaluator;
class="kw">import com.hypixel.hytale.procedurallib.property.NoiseProperty;
class="kw">import java.nio.file.Path;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class CellNoiseJsonLoader<K class="kw">extends SeedResource> class="kw">extends JsonLoader<K, NoiseFunction> {
   class="kw">public CellNoiseJsonLoader(@Nonnull SeedString<K> var1, Path var2, JsonElement var3) {
      super(var1.append(".CellNoise"), var2, var3);
   }

   @Nonnull
   class="kw">public NoiseFunction load() {
      CellDistanceFunction var1 = this.loadCellDistanceFunction();
      PointEvaluator var2 = this.loadPointEvaluator();
      CellNoise.CellFunction var3 = this.loadCellFunction();
      NoiseProperty var4 = this.loadNoiseLookup();
      class="kw">return new CellNoiseJsonLoader.LoadedCellNoise(var1, var2, var3, var4, this.seed.get());
   }

   @Nullable
   class="kw">protected CellDistanceFunction loadCellDistanceFunction() {
      class="kw">return new CellDistanceFunctionJsonLoader<>(this.seed, this.dataFolder, this.json, null).load();
   }

   @Nullable
   class="kw">protected PointEvaluator loadPointEvaluator() {
      class="kw">return new PointEvaluatorJsonLoader<>(this.seed, this.dataFolder, this.json).load();
   }

   class="kw">protected CellNoise.CellFunction loadCellFunction() {
      CellNoise.CellMode var1 = CellNoiseJsonLoader.Constants.DEFAULT_CELL_MODE;
      if (this.has("CellMode")) {
         var1 = CellNoise.CellMode.valueOf(this.get("CellMode").getAsString());
      }

      class="kw">return var1.getFunction();
   }

   @Nullable
   class="kw">protected NoiseProperty loadNoiseLookup() {
      NoiseProperty var1 = null;
      if (this.has("NoiseLookup")) {
         var1 = new NoisePropertyJsonLoader<>(this.seed, this.dataFolder, this.get("NoiseLookup")).load();
      }

      class="kw">return var1;
   }

   class="kw">public class="kw">interface Constants {
      String KEY_JITTER = "Jitter";
      String KEY_JITTER_X = "JitterX";
      String KEY_JITTER_Y = "JitterY";
      String KEY_JITTER_Z = "JitterZ";
      String KEY_DENSITY = "Density";
      String KEY_CELL_MODE = "CellMode";
      String KEY_NOISE_LOOKUP = "NoiseLookup";
      String KEY_DISTANCE_MODE = "DistanceMode";
      String KEY_DISTANCE_RANGE = "DistanceRange";
      String KEY_CELL_TYPE = "CellType";
      String KEY_SKIP_CELLS = "Skip";
      String KEY_SKIP_MODE = "SkipMode";
      double DEFAULT_JITTER = 1.0;
      double DEFAULT_DISTANCE_RANGE = 1.0;
      double DEFAULT_DENSITY_LOWER = 0.0;
      double DEFAULT_DENSITY_UPPER = 1.0;
      DistanceCalculationMode DEFAULT_DISTANCE_MODE = DistanceCalculationMode.EUCLIDEAN;
      CellNoise.CellMode DEFAULT_CELL_MODE = CellNoise.CellMode.CELL_VALUE;
      CellType DEFAULT_CELL_TYPE = CellType.SQUARE;
   }

   class="kw">private class="kw">static class LoadedCellNoise class="kw">extends CellNoise {
      class="kw">private class="kw">final SeedResource seedResource;

      class="kw">public LoadedCellNoise(CellDistanceFunction var1, PointEvaluator var2, CellNoise.CellFunction var3, @Nullable NoiseProperty var4, SeedResource var5) {
         super(var1, var2, var3, var4);
         this.seedResource = var5;
      }

      @Nonnull
      @Override
      class="kw">protected ResultBuffer.ResultBuffer2d localBuffer2d() {
         class="kw">return this.seedResource.localBuffer2d();
      }

      @Nonnull
      @Override
      class="kw">protected ResultBuffer.ResultBuffer3d localBuffer3d() {
         class="kw">return this.seedResource.localBuffer3d();
      }
   }
}