PortalDescription class

Пакет: com.hypixel.hytale.server.core.asset.type.portalworld

Файл: com/hypixel/hytale/server/core/asset/type/portalworld/PortalDescription.java

Поля (1)

МодификаторыТипИмя
final BuilderCodec<PortalDescription> CODEC

Методы (9)

МодификаторыВозвратСигнатура
public Message getDisplayNameMessage getDisplayName()
public String getDisplayNameKeyString getDisplayNameKey()
public Message getFlavorTextMessage getFlavorText()
public String getFlavorTextKeyString getFlavorTextKey()
public String[] getObjectivesKeysString[] getObjectivesKeys()
public List<PillTag> getPillTagsList<PillTag> getPillTags()
public String getSplashImageFilenameString getSplashImageFilename()
public Color getThemeColorColor getThemeColor()
public String[] getWisdomKeysString[] getWisdomKeys()

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.portalworld;

class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.common.util.ArrayUtil;
class="kw">import com.hypixel.hytale.protocol.Color;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.codec.ProtocolCodecs;
class="kw">import java.util.Arrays;
class="kw">import java.util.Collections;
class="kw">import java.util.List;

class="kw">public class PortalDescription {
   class="kw">public class="kw">static class="kw">final BuilderCodec<PortalDescription> CODEC = BuilderCodec.builder(PortalDescription.class, PortalDescription::new)
      .append(new KeyedCodec<>("DisplayName", Codec.STRING), (var0, var1) -> var0.displayNameKey = var1, var0 -> var0.displayNameKey)
      .documentation("The translation key for the name of this portal.")
      .add()
      .<String>append(new KeyedCodec<>("FlavorText", Codec.STRING), (var0, var1) -> var0.flavorTextKey = var1, var0 -> var0.flavorTextKey)
      .documentation("The translation key for the description of this portal.")
      .add()
      .<Color>append(new KeyedCodec<>("ThemeColor", ProtocolCodecs.COLOR), (var0, var1) -> var0.themeColor = var1, var0 -> var0.themeColor)
      .documentation("What color do you associate with this portal? May be used in many places.")
      .add()
      .<PillTag[]>append(
         new KeyedCodec<>("DescriptionTags", new ArrayCodec<>(PillTag.CODEC, PillTag[]::new)), (var0, var1) -> var0.pillTags = var1, var0 -> var0.pillTags
      )
      .documentation("Purely cosmetic list of tags for the UI.")
      .add()
      .<String[]>append(new KeyedCodec<>("Objectives", Codec.STRING_ARRAY), (var0, var1) -> var0.objectivesKeys = var1, var0 -> var0.objectivesKeys)
      .documentation("List of translation keys for the objectives in this portal.")
      .add()
      .<String[]>append(new KeyedCodec<>("Tips", Codec.STRING_ARRAY), (var0, var1) -> var0.wisdomKeys = var1, var0 -> var0.wisdomKeys)
      .documentation("List of translation keys for the tips/wisdom offered for this portal.")
      .add()
      .<String>append(new KeyedCodec<>("SplashImage", Codec.STRING), (var0, var1) -> var0.splashImageFilename = var1, var0 -> var0.splashImageFilename)
      .documentation(
         "The filename of the splash image for this portal. Your best bet to find the folder is to search for an existing portal's image in assets. Screenshots taken 60 fov."
      )
      .add()
      .build();
   class="kw">private String displayNameKey;
   class="kw">private String flavorTextKey;
   class="kw">private Color themeColor;
   class="kw">private PillTag[] pillTags;
   class="kw">private String[] objectivesKeys;
   class="kw">private String[] wisdomKeys;
   class="kw">private String splashImageFilename;

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

   class="kw">public String getDisplayNameKey() {
      class="kw">return this.displayNameKey;
   }

   class="kw">public Message getDisplayName() {
      class="kw">return Message.translation(this.displayNameKey);
   }

   class="kw">public String getFlavorTextKey() {
      class="kw">return this.flavorTextKey;
   }

   class="kw">public Message getFlavorText() {
      class="kw">return Message.translation(this.flavorTextKey);
   }

   class="kw">public Color getThemeColor() {
      class="kw">return this.themeColor;
   }

   class="kw">public List<PillTag> getPillTags() {
      class="kw">return this.pillTags == null ? Collections.emptyList() : Arrays.asList(this.pillTags);
   }

   class="kw">public String[] getObjectivesKeys() {
      class="kw">return this.objectivesKeys == null ? ArrayUtil.EMPTY_STRING_ARRAY : this.objectivesKeys;
   }

   class="kw">public String[] getWisdomKeys() {
      class="kw">return this.wisdomKeys == null ? ArrayUtil.EMPTY_STRING_ARRAY : this.wisdomKeys;
   }

   class="kw">public String getSplashImageFilename() {
      class="kw">return this.splashImageFilename;
   }
}