Constants interface
Пакет: com.hypixel.hytale.server.worldgen.loader.cave
Файл: com/hypixel/hytale/server/worldgen/loader/cave/CavePrefabEntryJsonLoader.java
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
String |
KEY_CONFIG |
|
String |
KEY_PREFAB |
|
String |
KEY_WEIGHT |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.loader.cave;
class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.common.map.IWeightedMap;
class="kw">import com.hypixel.hytale.procedurallib.json.JsonLoader;
class="kw">import com.hypixel.hytale.procedurallib.json.SeedString;
class="kw">import com.hypixel.hytale.server.worldgen.SeedStringResource;
class="kw">import com.hypixel.hytale.server.worldgen.cave.prefab.CavePrefabContainer;
class="kw">import com.hypixel.hytale.server.worldgen.loader.WorldGenPrefabSupplier;
class="kw">import com.hypixel.hytale.server.worldgen.loader.context.ZoneFileContext;
class="kw">import com.hypixel.hytale.server.worldgen.loader.prefab.WeightedPrefabMapJsonLoader;
class="kw">import java.nio.file.Path;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class CavePrefabEntryJsonLoader class="kw">extends JsonLoader<SeedStringResource, CavePrefabContainer.CavePrefabEntry> {
class="kw">private class="kw">final ZoneFileContext zoneContext;
class="kw">public CavePrefabEntryJsonLoader(@Nonnull SeedString<SeedStringResource> var1, Path var2, JsonElement var3, ZoneFileContext var4) {
super(var1.append(".CavePrefabEntry"), var2, var3);
this.zoneContext = var4;
}
@Nonnull
class="kw">public CavePrefabContainer.CavePrefabEntry load() {
class="kw">return new CavePrefabContainer.CavePrefabEntry(this.loadPrefabs(), this.loadConfig());
}
@Nullable
class="kw">protected IWeightedMap<WorldGenPrefabSupplier> loadPrefabs() {
class="kw">return new WeightedPrefabMapJsonLoader(this.seed, this.dataFolder, this.json, "Prefab", "Weight").load();
}
@Nonnull
class="kw">protected CavePrefabContainer.CavePrefabEntry.CavePrefabConfig loadConfig() {
class="kw">return new CavePrefabConfigJsonLoader(this.seed, this.dataFolder, this.get("Config"), this.zoneContext).load();
}
class="kw">public class="kw">interface Constants {
String KEY_PREFAB = "Prefab";
String KEY_WEIGHT = "Weight";
String KEY_CONFIG = "Config";
}
}