ReachLocationMarker class

Пакет: com.hypixel.hytale.builtin.adventure.objectives.markers.reachlocation

Файл: com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarker.java

implements: Component<EntityStore>

Поля (2)

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

Методы (2)

МодификаторыВозвратСигнатура
static ComponentType<EntityStore, ReachLocationMarker> getComponentTypeComponentType<EntityStore, ReachLocationMarker> getComponentType()
public String getMarkerIdString getMarkerId()

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.objectives.markers.reachlocation;

class="kw">import com.hypixel.hytale.builtin.adventure.objectives.ObjectivePlugin;
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.universe.world.storage.EntityStore;
class="kw">import java.util.HashSet;
class="kw">import java.util.Set;
class="kw">import java.util.UUID;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class ReachLocationMarker class="kw">implements Component<EntityStore> {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<ReachLocationMarker> CODEC = BuilderCodec.builder(ReachLocationMarker.class, ReachLocationMarker::new)
      .append(new KeyedCodec<>("MarkerId", Codec.STRING), (var0, var1) -> var0.markerId = var1, var0 -> var0.markerId)
      .addValidator(Validators.nonNull())
      .add()
      .build();
   class="kw">private String markerId;
   @Nonnull
   class="kw">private class="kw">final Set<UUID> players = new HashSet<>();

   class="kw">public class="kw">static ComponentType<EntityStore, ReachLocationMarker> getComponentType() {
      class="kw">return ObjectivePlugin.get().getReachLocationMarkerComponentType();
   }

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

   class="kw">public ReachLocationMarker(String var1) {
      this.markerId = var1;
   }

   class="kw">public String getMarkerId() {
      class="kw">return this.markerId;
   }

   @Nullable
   class="kw">public String getLocationName() {
      ReachLocationMarkerAsset var1 = ReachLocationMarkerAsset.getAssetMap().getAsset(this.markerId);
      class="kw">return var1 != null ? var1.getName() : null;
   }

   @Nonnull
   class="kw">public Set<UUID> getPlayers() {
      class="kw">return this.players;
   }

   @Nonnull
   @Override
   class="kw">public Component<EntityStore> clone() {
      ReachLocationMarker var1 = new ReachLocationMarker(this.markerId);
      var1.players.addAll(this.players);
      class="kw">return var1;
   }
}