PillTag class

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

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

Поля (1)

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

Методы (3)

МодификаторыВозвратСигнатура
public Color getColorColor getColor()
public Message getMessageMessage getMessage()
public String getTranslationKeyString getTranslationKey()

Исходный код

Показать/скрыть
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.protocol.Color;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.codec.ProtocolCodecs;

class="kw">public class PillTag {
   class="kw">public class="kw">static class="kw">final BuilderCodec<PillTag> CODEC = BuilderCodec.builder(PillTag.class, PillTag::new)
      .appendInherited(
         new KeyedCodec<>("TranslationKey", Codec.STRING),
         (var0, var1) -> var0.translationKey = var1,
         var0 -> var0.translationKey,
         (var0, var1) -> var0.translationKey = var1.translationKey
      )
      .documentation("The translation key for the text of this tag.")
      .add()
      .appendInherited(
         new KeyedCodec<>("Color", ProtocolCodecs.COLOR), (var0, var1) -> var0.color = var1, var0 -> var0.color, (var0, var1) -> var0.color = var1.color
      )
      .add()
      .build();
   class="kw">public class="kw">static class="kw">final PillTag[] EMPTY_LIST = new PillTag[0];
   class="kw">private String translationKey;
   class="kw">private Color color;

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

   class="kw">public String getTranslationKey() {
      class="kw">return this.translationKey;
   }

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

   class="kw">public Color getColor() {
      class="kw">return this.color;
   }

   @Override
   class="kw">public String toString() {
      class="kw">return "PillTag{translationKey='" + this.translationKey + "', color=" + this.color + "}";
   }
}