ShapeDistortionJsonLoader class
Пакет: com.hypixel.hytale.server.worldgen.loader.cave.shape
Файл: com/hypixel/hytale/server/worldgen/loader/cave/shape/ShapeDistortionJsonLoader.java
extends: JsonLoader<K, ShapeDistortion>
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
String |
KEY_CEILING |
|
String |
KEY_FLOOR |
|
String |
KEY_WIDTH |
Методы (1)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
ShapeDistortion |
loadShapeDistortion load() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.loader.cave.shape;
class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.procedurallib.json.JsonLoader;
class="kw">import com.hypixel.hytale.procedurallib.json.NoisePropertyJsonLoader;
class="kw">import com.hypixel.hytale.procedurallib.json.SeedResource;
class="kw">import com.hypixel.hytale.procedurallib.json.SeedString;
class="kw">import com.hypixel.hytale.procedurallib.property.NoiseProperty;
class="kw">import com.hypixel.hytale.server.worldgen.cave.shape.distorted.ShapeDistortion;
class="kw">import java.nio.file.Path;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ShapeDistortionJsonLoader<K class="kw">extends SeedResource> class="kw">extends JsonLoader<K, ShapeDistortion> {
class="kw">public ShapeDistortionJsonLoader(@Nonnull SeedString<K> var1, Path var2, JsonElement var3) {
super(var1.append(".ShapeDistortion"), var2, var3);
}
class="kw">public ShapeDistortion load() {
class="kw">return ShapeDistortion.of(this.loadWidth(), this.loadFloor(), this.loadCeiling());
}
@Nullable
class="kw">private NoiseProperty loadWidth() {
class="kw">return this.has("Width") ? new NoisePropertyJsonLoader<>(this.seed, this.dataFolder, this.get("Width")).load() : null;
}
@Nullable
class="kw">private NoiseProperty loadFloor() {
class="kw">return this.has("Floor") ? new NoisePropertyJsonLoader<>(this.seed, this.dataFolder, this.get("Floor")).load() : null;
}
@Nullable
class="kw">private NoiseProperty loadCeiling() {
class="kw">return this.has("Ceiling") ? new NoisePropertyJsonLoader<>(this.seed, this.dataFolder, this.get("Ceiling")).load() : null;
}
class="kw">public class="kw">interface Constants {
String KEY_WIDTH = "Width";
String KEY_FLOOR = "Floor";
String KEY_CEILING = "Ceiling";
}
}