NoiseMaskConditionJsonLoader class
Пакет: com.hypixel.hytale.procedurallib.json
Файл: com/hypixel/hytale/procedurallib/json/NoiseMaskConditionJsonLoader.java
extends: JsonLoader<K, ICoordinateCondition>
Поля (7)
| Модификаторы | Тип | Имя |
|---|---|---|
|
String |
ERROR_THRESHOLD |
|
String |
KEY_THRESHOLD |
final |
boolean |
defaultValue |
|
ICoordinateCondition |
var1 |
|
|
var1 |
|
NoiseProperty |
var2 |
|
IDoubleCondition |
var3 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
throw new |
IllegalStateExceptionthrow new IllegalStateException("Could not find threshold data in noise mask. Keyword: Threshold") |
abstract |
|
this this(var1, var2, var3, true) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.procedurallib.json;
class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.procedurallib.condition.DefaultCoordinateCondition;
class="kw">import com.hypixel.hytale.procedurallib.condition.ICoordinateCondition;
class="kw">import com.hypixel.hytale.procedurallib.condition.IDoubleCondition;
class="kw">import com.hypixel.hytale.procedurallib.condition.NoiseMaskCondition;
class="kw">import com.hypixel.hytale.procedurallib.property.NoiseProperty;
class="kw">import java.nio.file.Path;
class="kw">import javax.annotation.Nonnull;
class="kw">public class NoiseMaskConditionJsonLoader<K class="kw">extends SeedResource> class="kw">extends JsonLoader<K, ICoordinateCondition> {
class="kw">protected class="kw">final boolean defaultValue;
class="kw">public NoiseMaskConditionJsonLoader(@Nonnull SeedString<K> var1, Path var2, JsonElement var3) {
this(var1, var2, var3, true);
}
class="kw">public NoiseMaskConditionJsonLoader(@Nonnull SeedString<K> var1, Path var2, JsonElement var3, boolean var4) {
super(var1.append(".NoiseMaskCondition"), var2, var3);
this.defaultValue = var4;
}
@Nonnull
class="kw">public ICoordinateCondition load() {
ICoordinateCondition var1 = this.defaultValue ? DefaultCoordinateCondition.DEFAULT_TRUE : DefaultCoordinateCondition.DEFAULT_FALSE;
if (this.json != null && !this.json.isJsonNull()) {
if (!this.has("Threshold")) {
throw new IllegalStateException("Could not find threshold data in noise mask. Keyword: Threshold");
}
NoiseProperty var2 = new NoisePropertyJsonLoader<>(this.seed, this.dataFolder, this.json).load();
IDoubleCondition var3 = new DoubleConditionJsonLoader<>(this.seed, this.dataFolder, this.get("Threshold")).load();
var1 = new NoiseMaskCondition(var2, var3);
}
class="kw">return var1;
}
class="kw">public class="kw">interface Constants {
String KEY_THRESHOLD = "Threshold";
String ERROR_THRESHOLD = "Could not find threshold data in noise mask. Keyword: Threshold";
}
}