MovementAudioComponent class
Пакет: com.hypixel.hytale.server.core.modules.entity.component
Файл: com/hypixel/hytale/server/core/modules/entity/component/MovementAudioComponent.java
implements: Component<EntityStore>
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
static |
float |
NO_REPEAT |
|
protected Ref<EntityStore> |
owner |
Методы (8)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public |
ShouldHearPredicatepublic ShouldHearPredicate() |
public |
boolean |
canMoveInRepeatboolean canMoveInRepeat() |
static |
ComponentType<EntityStore, MovementAudioComponent> |
getComponentTypeComponentType<EntityStore, MovementAudioComponent> getComponentType() |
public |
int |
getLastInsideBlockTypeIdint getLastInsideBlockTypeId() |
public |
void |
setLastInsideBlockTypeIdvoid setLastInsideBlockTypeId(int var1) |
public |
void |
setNextMoveInRepeatvoid setNextMoveInRepeat(float var1) |
|
public boolean |
testpublic boolean test(@Nonnull Ref<EntityStore> var1) |
public |
boolean |
tickMoveInRepeatboolean tickMoveInRepeat(float var1) |
Исходный код
Показать/скрыть
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.component.Ref;
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 java.util.function.Predicate;
class="kw">import javax.annotation.Nonnull;
class="kw">public class MovementAudioComponent class="kw">implements Component<EntityStore> {
class="kw">public class="kw">static float NO_REPEAT = -1.0F;
class="kw">private class="kw">final MovementAudioComponent.ShouldHearPredicate shouldHearPredicate = new MovementAudioComponent.ShouldHearPredicate();
class="kw">private int lastInsideBlockTypeId = 0;
class="kw">private float nextMoveInRepeat = NO_REPEAT;
class="kw">public class="kw">static ComponentType<EntityStore, MovementAudioComponent> getComponentType() {
class="kw">return EntityModule.get().getMovementAudioComponentType();
}
class="kw">public MovementAudioComponent() {
}
@Nonnull
class="kw">public MovementAudioComponent.ShouldHearPredicate getShouldHearPredicate(Ref<EntityStore> var1) {
this.shouldHearPredicate.owner = var1;
class="kw">return this.shouldHearPredicate;
}
class="kw">public int getLastInsideBlockTypeId() {
class="kw">return this.lastInsideBlockTypeId;
}
class="kw">public void setLastInsideBlockTypeId(int var1) {
this.lastInsideBlockTypeId = var1;
}
class="kw">public boolean canMoveInRepeat() {
class="kw">return this.nextMoveInRepeat != NO_REPEAT;
}
class="kw">public boolean tickMoveInRepeat(float var1) {
class="kw">return (this.nextMoveInRepeat -= var1) <= 0.0F;
}
class="kw">public void setNextMoveInRepeat(float var1) {
this.nextMoveInRepeat = var1;
}
@Nonnull
@Override
class="kw">public Component<EntityStore> clone() {
class="kw">return new MovementAudioComponent();
}
class="kw">public class="kw">static class ShouldHearPredicate class="kw">implements Predicate<Ref<EntityStore>> {
class="kw">protected Ref<EntityStore> owner;
class="kw">public ShouldHearPredicate() {
}
class="kw">public boolean test(@Nonnull Ref<EntityStore> var1) {
class="kw">return !this.owner.equals(var1);
}
}
}