BuilderActionState class
Пакет: com.hypixel.hytale.server.npc.corecomponents.statemachine.builders
Файл: com/hypixel/hytale/server/npc/corecomponents/statemachine/builders/BuilderActionState.java
extends: BuilderActionBase
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
protected |
String |
state |
Методы (7)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
return new |
ActionStatereturn new ActionState(this, var1) |
public |
int |
getStateIndexint getStateIndex() |
public |
int |
getSubStateIndexint getSubStateIndex() |
public |
boolean |
isClearBodyMotionboolean isClearBodyMotion() |
public |
boolean |
isClearHeadMotionboolean isClearHeadMotion() |
public |
boolean |
isClearStateboolean isClearState() |
public |
boolean |
isComponentLocalboolean isComponentLocal() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.corecomponents.statemachine.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.corecomponents.builders.BuilderActionBase;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.statemachine.ActionState;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BuilderActionState class="kw">extends BuilderActionBase {
class="kw">protected String state;
class="kw">protected String subState;
class="kw">protected int stateIndex;
class="kw">protected int subStateIndex;
class="kw">protected boolean clearState;
class="kw">protected boolean clearHeadMotion;
class="kw">protected boolean clearBodyMotion;
class="kw">protected boolean componentLocal;
class="kw">public BuilderActionState() {
}
@Nonnull
class="kw">public ActionState build(@Nonnull BuilderSupport var1) {
class="kw">return new ActionState(this, var1);
}
@Nonnull
@Override
class="kw">public String getShortDescription() {
class="kw">return "Set state of NPC";
}
@Nonnull
@Override
class="kw">public String getLongDescription() {
class="kw">return "Set state of NPC. The state can be queried with a sensor later on.";
}
@Nonnull
@Override
class="kw">public BuilderDescriptorState getBuilderDescriptorState() {
class="kw">return BuilderDescriptorState.Stable;
}
@Nonnull
class="kw">public BuilderActionState readConfig(@Nonnull JsonElement var1) {
this.requireStateString(var1, "State", true, (var1x, var2, var3) -> {
this.state = var1x;
this.subState = var2;
}, BuilderDescriptorState.Stable, "State name to set", null);
this.getBoolean(
var1,
"ClearState",
var1x -> this.clearState = var1x,
true,
BuilderDescriptorState.Stable,
"Clear the state of things like set once flags on transition",
null
);
this.getBoolean(
var1,
"ClearHeadMotion",
var1x -> this.clearHeadMotion = var1x,
true,
BuilderDescriptorState.Stable,
"Whether the head motion will be cleared during the state transition actions",
null
);
this.getBoolean(
var1,
"ClearBodyMotion",
var1x -> this.clearBodyMotion = var1x,
true,
BuilderDescriptorState.Stable,
"Whether the body motion will be cleared during the state transition actions",
null
);
this.componentLocal = this.isComponent();
this.registerStateSetter(this.state, this.subState, (var1x, var2) -> {
this.stateIndex = var1x;
this.subStateIndex = var2;
});
this.requireInstructionType(InstructionType.StateChangeAllowedInstructions);
class="kw">return this;
}
class="kw">public int getStateIndex() {
class="kw">return this.stateIndex;
}
class="kw">public int getSubStateIndex() {
class="kw">return this.subStateIndex;
}
class="kw">public boolean isClearState() {
class="kw">return this.clearState;
}
class="kw">public boolean isClearHeadMotion() {
class="kw">return this.clearHeadMotion;
}
class="kw">public boolean isClearBodyMotion() {
class="kw">return this.clearBodyMotion;
}
class="kw">public boolean isComponentLocal() {
class="kw">return this.componentLocal;
}
}