Constants interface
Пакет: com.hypixel.hytale.server.worldgen.loader.climate
Файл: com/hypixel/hytale/server/worldgen/loader/climate/ClimateColorJsonLoader.java
Поля (4)
| Модификаторы | Тип | Имя |
|---|---|---|
|
String |
KEY_COLOR |
|
String |
KEY_OCEAN |
|
String |
KEY_SHALLOW_OCEAN |
|
String |
KEY_SHORE |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.loader.climate;
class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.procedurallib.json.JsonLoader;
class="kw">import com.hypixel.hytale.procedurallib.json.SeedResource;
class="kw">import com.hypixel.hytale.procedurallib.json.SeedString;
class="kw">import com.hypixel.hytale.server.worldgen.climate.ClimateColor;
class="kw">import com.hypixel.hytale.server.worldgen.loader.util.ColorUtil;
class="kw">import java.nio.file.Path;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ClimateColorJsonLoader<K class="kw">extends SeedResource> class="kw">extends JsonLoader<K, ClimateColor> {
@Nullable
class="kw">private class="kw">final ClimateColor parent;
class="kw">public ClimateColorJsonLoader(SeedString<K> var1, Path var2, @Nullable JsonElement var3, @Nullable ClimateColor var4) {
super(var1, var2, var3);
this.parent = var4;
}
@Nonnull
class="kw">public ClimateColor load() {
class="kw">return new ClimateColor(
this.loadColor("Color", -1),
this.loadColor("Shore", this.parent != null ? this.parent.shore : -1),
this.loadColor("Ocean", this.parent != null ? this.parent.ocean : -1),
this.loadColor("ShallowOcean", this.parent != null ? this.parent.shallowOcean : -1)
);
}
class="kw">protected int loadColor(@Nonnull String var1, int var2) {
if (this.has(var1)) {
String var3 = this.mustGetString(var1, null);
class="kw">return ColorUtil.hexString(var3);
} else {
class="kw">return var2;
}
}
class="kw">public class="kw">interface Constants {
String KEY_COLOR = "Color";
String KEY_SHORE = "Shore";
String KEY_OCEAN = "Ocean";
String KEY_SHALLOW_OCEAN = "ShallowOcean";
}
}