Constants interface

Пакет: com.hypixel.hytale.server.worldgen.loader

Файл: com/hypixel/hytale/server/worldgen/loader/ZonesJsonLoader.java

Поля (3)

МодификаторыТипИмя
String ERROR_LOADING_ZONE
String FILE_ZONE_MAIN_FILE
String PATH_ZONES

Исходный код

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

class="kw">import com.google.gson.JsonObject;
class="kw">import com.hypixel.hytale.procedurallib.file.FileIO;
class="kw">import com.hypixel.hytale.procedurallib.json.JsonLoader;
class="kw">import com.hypixel.hytale.procedurallib.json.Loader;
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.loader.context.FileContext;
class="kw">import com.hypixel.hytale.server.worldgen.loader.context.FileLoadingContext;
class="kw">import com.hypixel.hytale.server.worldgen.loader.context.ZoneFileContext;
class="kw">import com.hypixel.hytale.server.worldgen.loader.zone.ZoneJsonLoader;
class="kw">import com.hypixel.hytale.server.worldgen.zone.Zone;
class="kw">import java.nio.file.Path;
class="kw">import java.util.Map.Entry;
class="kw">import javax.annotation.Nonnull;

class="kw">public class ZonesJsonLoader class="kw">extends Loader<SeedStringResource, Zone[]> {
   class="kw">protected class="kw">final FileLoadingContext loadingContext;

   class="kw">public ZonesJsonLoader(@Nonnull SeedString<SeedStringResource> var1, Path var2, FileLoadingContext var3) {
      super(var1.append(".Zones"), var2);
      this.loadingContext = var3;
   }

   @Nonnull
   class="kw">public Zone[] load() {
      FileContext.Registry var1 = this.loadingContext.getZones();
      int var2 = 0;
      Zone[] var3 = new Zone[var1.size()];

      for (Entry var5 : var1) {
         ZoneFileContext var6 = var5.getValue();

         try {
            JsonObject var7 = FileIO.load(var6.getPath().resolve("Zone.json"), JsonLoader.JSON_OBJ_LOADER);
            Zone var8 = new ZoneJsonLoader(this.seed, this.dataFolder, var7, var6).load();
            var3[var2++] = var8;
         } catch (Throwable var9) {
            throw new Error(String.format("Error while loading zone \"%s\" for world generator from file.", var6.getPath().toString()), var9);
         }
      }

      class="kw">return var3;
   }

   class="kw">public class="kw">interface Constants {
      String PATH_ZONES = "Zones";
      String FILE_ZONE_MAIN_FILE = "Zone.json";
      String ERROR_LOADING_ZONE = "Error while loading zone \"%s\" for world generator from file.";
   }
}