FileContent class

Пакет: com.hypixel.hytale.builtin.worldgen.modifier.content

Файл: com/hypixel/hytale/builtin/worldgen/modifier/content/FileContent.java

implements: Content

Поля (2)

МодификаторыТипИмя
final String ID
Object var2

Методы (1)

МодификаторыВозвратСигнатура
if if(var2 != null)

Исходный код

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

class="kw">import com.hypixel.hytale.builtin.worldgen.modifier.event.ModifyEvent;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;

class="kw">public class FileContent class="kw">implements Content {
   class="kw">public class="kw">static class="kw">final String ID = "File";
   class="kw">public class="kw">static class="kw">final BuilderCodec<FileContent> CODEC = BuilderCodec.builder(FileContent.class, FileContent::new)
      .documentation("File content to be loaded and added to the target content list")
      .<Content.Type>append(new KeyedCodec<>("ContentType", Content.Type.CODEC), (var0, var1) -> var0.type = var1, var0 -> var0.type)
      .documentation("The type of the content to load")
      .add()
      .<String>append(new KeyedCodec<>("Path", BuilderCodec.STRING), (var0, var1) -> var0.path = var1, var0 -> var0.path)
      .documentation("A dot-separated path to a content file within the target world-gen root folder")
      .add()
      .build();
   class="kw">protected Content.Type type = Content.Type.NONE;
   class="kw">protected String path = "";

   class="kw">public FileContent() {
   }

   @Override
   class="kw">public Content.Type type() {
      class="kw">return this.type;
   }

   @Override
   class="kw">public <T> void applyTo(ModifyEvent<T> var1) class="kw">throws Exception {
      Object var2 = var1.loader().load(this.path);
      if (var2 != null) {
         var1.entries().add(var2);
      }
   }

   @Override
   class="kw">public String toString() {
      class="kw">return "FileContent{Path=" + this.path + "}";
   }
}