BuilderActionDelayDespawn class
Пакет: com.hypixel.hytale.server.npc.corecomponents.lifecycle.builders
Файл: com/hypixel/hytale/server/npc/corecomponents/lifecycle/builders/BuilderActionDelayDespawn.java
extends: BuilderActionBase
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
protected |
float |
time |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
return new |
ActionDelayDespawnreturn new ActionDelayDespawn(this) |
public |
boolean |
getShortenboolean getShorten() |
public |
float |
getTimefloat getTime() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.corecomponents.lifecycle.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.InstructionType;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.validators.DoubleSingleValidator;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.builders.BuilderActionBase;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.lifecycle.ActionDelayDespawn;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BuilderActionDelayDespawn class="kw">extends BuilderActionBase {
class="kw">protected float time;
class="kw">protected boolean shorten;
class="kw">public BuilderActionDelayDespawn() {
}
@Nonnull
@Override
class="kw">public String getShortDescription() {
class="kw">return "Delay the despawning cycle for some amount of time";
}
@Nonnull
@Override
class="kw">public String getLongDescription() {
class="kw">return "Delay the despawning cycle for some amount of time";
}
@Nonnull
@Override
class="kw">public BuilderDescriptorState getBuilderDescriptorState() {
class="kw">return BuilderDescriptorState.Stable;
}
@Nonnull
class="kw">public ActionDelayDespawn build(BuilderSupport var1) {
class="kw">return new ActionDelayDespawn(this);
}
@Nonnull
class="kw">public BuilderActionDelayDespawn readConfig(@Nonnull JsonElement var1) {
this.requireFloat(
var1, "Time", var1x -> this.time = var1x, DoubleSingleValidator.greater0(), BuilderDescriptorState.Stable, "How long to set the to delay", null
);
this.getBoolean(
var1,
"Shorten",
var1x -> this.shorten = var1x,
false,
BuilderDescriptorState.Stable,
"Set the delay to either the current delay or the given time. Whatever is smaller.",
null
);
this.requireInstructionType(InstructionType.NPCOnlyInstructions);
class="kw">return this;
}
class="kw">public float getTime() {
class="kw">return this.time;
}
class="kw">public boolean getShorten() {
class="kw">return this.shorten;
}
}