ActionPlayAnimation class
Пакет: com.hypixel.hytale.server.npc.corecomponents.audiovisual
Файл: com/hypixel/hytale/server/npc/corecomponents/audiovisual/ActionPlayAnimation.java
extends: ActionBase
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
NPCAnimationSlot |
slot |
|
NPCEntity |
var7 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
protected |
void |
setAnimationIdvoid setAnimationId(String var1) |
abstract |
|
super super(var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.corecomponents.audiovisual;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import com.hypixel.hytale.server.npc.animations.NPCAnimationSlot;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.BuilderSupport;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.ActionBase;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.audiovisual.builders.BuilderActionPlayAnimation;
class="kw">import com.hypixel.hytale.server.npc.entities.NPCEntity;
class="kw">import com.hypixel.hytale.server.npc.instructions.ExecutionSupport;
class="kw">import com.hypixel.hytale.server.npc.sensorinfo.InfoProvider;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ActionPlayAnimation class="kw">extends ActionBase {
class="kw">protected class="kw">final NPCAnimationSlot slot;
@Nullable
class="kw">protected String animationId;
class="kw">public ActionPlayAnimation(@Nonnull BuilderActionPlayAnimation var1, @Nonnull BuilderSupport var2) {
super(var1);
this.slot = var1.getSlot();
this.animationId = var1.getAnimationId(var2);
}
@Override
class="kw">public boolean execute(
@Nonnull Ref<EntityStore> var1, @Nonnull ExecutionSupport var2, @Nullable InfoProvider var3, double var4, @Nonnull Store<EntityStore> var6
) {
super.execute(var1, var2, var3, var4, var6);
NPCEntity var7 = var6.getComponent(var1, NPCEntity.getComponentType());
assert var7 != null;
var7.playAnimation(var1, this.slot.getMappedSlot(), this.animationId, var6);
class="kw">return true;
}
class="kw">protected void setAnimationId(String var1) {
this.animationId = var1;
}
}