Nameplate class

Пакет: com.hypixel.hytale.server.core.entity.nameplate

Файл: com/hypixel/hytale/server/core/entity/nameplate/Nameplate.java

implements: Component<EntityStore>

Поля (2)

МодификаторыТипИмя
boolean var1
Nameplate var1

Методы (2)

МодификаторыВозвратСигнатура
public boolean consumeNetworkOutdatedboolean consumeNetworkOutdated()
public void setTextvoid setText(@Nonnull String var1)

Исходный код

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

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.validation.Validators;
class="kw">import com.hypixel.hytale.component.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;

class="kw">public class Nameplate class="kw">implements Component<EntityStore> {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<Nameplate> CODEC = BuilderCodec.builder(Nameplate.class, Nameplate::new)
      .append(new KeyedCodec<>("Text", Codec.STRING), (var0, var1) -> var0.text = var1, var0 -> var0.text)
      .documentation("The contents to display as the nameplate text.")
      .addValidator(Validators.nonNull())
      .add()
      .build();
   @Nonnull
   class="kw">private String text = "";
   class="kw">private boolean isNetworkOutdated = true;

   @Nonnull
   class="kw">public class="kw">static ComponentType<EntityStore, Nameplate> getComponentType() {
      class="kw">return EntityModule.get().getNameplateComponentType();
   }

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

   class="kw">public Nameplate(@Nonnull String var1) {
      this.text = var1;
   }

   @Nonnull
   class="kw">public String getText() {
      class="kw">return this.text;
   }

   class="kw">public void setText(@Nonnull String var1) {
      if (!this.text.equals(var1)) {
         this.text = var1;
         this.isNetworkOutdated = true;
      }
   }

   class="kw">public boolean consumeNetworkOutdated() {
      boolean var1 = this.isNetworkOutdated;
      this.isNetworkOutdated = false;
      class="kw">return var1;
   }

   @Nonnull
   @Override
   class="kw">public Component<EntityStore> clone() {
      Nameplate var1 = new Nameplate();
      var1.text = this.text;
      class="kw">return var1;
   }
}