ActiveAnimationComponent class
Пакет: com.hypixel.hytale.server.core.modules.entity.component
Файл: com/hypixel/hytale/server/core/modules/entity/component/ActiveAnimationComponent.java
implements: Component<EntityStore>
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
String[] |
activeAnimations |
|
boolean |
var1 |
Методы (4)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
boolean |
consumeNetworkOutdatedboolean consumeNetworkOutdated() |
public |
String[] |
getActiveAnimationsString[] getActiveAnimations() |
static |
ComponentType<EntityStore, ActiveAnimationComponent> |
getComponentTypeComponentType<EntityStore, ActiveAnimationComponent> getComponentType() |
public |
void |
setPlayingAnimationvoid setPlayingAnimation(AnimationSlot var1, @Nullable String var2) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.entity.component;
class="kw">import com.hypixel.hytale.component.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.protocol.AnimationSlot;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ActiveAnimationComponent class="kw">implements Component<EntityStore> {
class="kw">private class="kw">final String[] activeAnimations = new String[AnimationSlot.VALUES.length];
class="kw">private boolean isNetworkOutdated = false;
class="kw">public class="kw">static ComponentType<EntityStore, ActiveAnimationComponent> getComponentType() {
class="kw">return EntityModule.get().getActiveAnimationComponentType();
}
class="kw">public ActiveAnimationComponent() {
}
class="kw">public ActiveAnimationComponent(String[] var1) {
System.arraycopy(var1, 0, this.activeAnimations, 0, var1.length);
}
class="kw">public String[] getActiveAnimations() {
class="kw">return this.activeAnimations;
}
class="kw">public void setPlayingAnimation(AnimationSlot var1, @Nullable String var2) {
if (this.activeAnimations[var1.ordinal()] == null || !this.activeAnimations[var1.ordinal()].equals(var2)) {
this.activeAnimations[var1.ordinal()] = var2;
}
}
class="kw">public boolean consumeNetworkOutdated() {
boolean var1 = this.isNetworkOutdated;
this.isNetworkOutdated = false;
class="kw">return var1;
}
@Nonnull
@Override
class="kw">public Component<EntityStore> clone() {
class="kw">return new ActiveAnimationComponent(this.activeAnimations);
}
}