BuilderActionSetLeashPosition class

Пакет: com.hypixel.hytale.server.npc.corecomponents.world.builders

Файл: com/hypixel/hytale/server/npc/corecomponents/world/builders/BuilderActionSetLeashPosition.java

extends: BuilderActionBase

Поля (1)

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

Методы (3)

МодификаторыВозвратСигнатура
abstract return new ActionSetLeashPositionreturn new ActionSetLeashPosition(this)
public boolean isToCurrentboolean isToCurrent()
public boolean isToTargetboolean isToTarget()

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.corecomponents.world.builders;

class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.BuilderDescriptorState;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.BuilderSupport;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.Feature;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.InstructionType;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.builders.BuilderActionBase;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.world.ActionSetLeashPosition;
class="kw">import javax.annotation.Nonnull;

class="kw">public class BuilderActionSetLeashPosition class="kw">extends BuilderActionBase {
   class="kw">protected boolean toTarget;
   class="kw">protected boolean toCurrent;

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

   @Nonnull
   class="kw">public ActionSetLeashPosition build(@Nonnull BuilderSupport var1) {
      var1.setRequireLeashPosition();
      class="kw">return new ActionSetLeashPosition(this);
   }

   @Nonnull
   @Override
   class="kw">public String getShortDescription() {
      class="kw">return "Sets the NPCs current position to the spawn/leash position";
   }

   @Nonnull
   @Override
   class="kw">public String getLongDescription() {
      class="kw">return "Sets the NPCs current position to the spawn/leash position to be used with the Leash Sensor.";
   }

   @Nonnull
   @Override
   class="kw">public BuilderDescriptorState getBuilderDescriptorState() {
      class="kw">return BuilderDescriptorState.Stable;
   }

   @Nonnull
   class="kw">public BuilderActionSetLeashPosition readConfig(@Nonnull JsonElement var1) {
      this.getBoolean(var1, "ToCurrent", var1x -> this.toCurrent = var1x, false, BuilderDescriptorState.Stable, "Set to the NPCs current position.", null);
      this.getBoolean(var1, "ToTarget", var1x -> this.toTarget = var1x, false, BuilderDescriptorState.Stable, "Set to the target position.", null);
      this.validateAny("ToCurrent", this.toCurrent, "ToTarget", this.toTarget);
      this.requireFeatureIf("ToTarget", true, this.toTarget, Feature.AnyEntity);
      this.requireInstructionType(InstructionType.NPCOnlyInstructions);
      class="kw">return this;
   }

   class="kw">public boolean isToTarget() {
      class="kw">return this.toTarget;
   }

   class="kw">public boolean isToCurrent() {
      class="kw">return this.toCurrent;
   }
}