AudioComponent class

Пакет: com.hypixel.hytale.server.core.modules.entity.component

Файл: com/hypixel/hytale/server/core/modules/entity/component/AudioComponent.java

implements: Component<EntityStore>

Поля (2)

МодификаторыТипИмя
private IntList soundEventIds
boolean var1

Методы (4)

МодификаторыВозвратСигнатура
public void addSoundvoid addSound(int var1)
public boolean consumeNetworkOutdatedboolean consumeNetworkOutdated()
static ComponentType<EntityStore, AudioComponent> getComponentTypeComponentType<EntityStore, AudioComponent> getComponentType()
public int[] getSoundEventIdsint[] getSoundEventIds()

Исходный код

Показать/скрыть
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.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import it.unimi.dsi.fastutil.ints.IntArrayList;
class="kw">import it.unimi.dsi.fastutil.ints.IntList;
class="kw">import javax.annotation.Nonnull;

class="kw">public class AudioComponent class="kw">implements Component<EntityStore> {
   class="kw">private IntList soundEventIds = new IntArrayList();
   class="kw">private boolean isNetworkOutdated = true;

   class="kw">public class="kw">static ComponentType<EntityStore, AudioComponent> getComponentType() {
      class="kw">return EntityModule.get().getAudioComponentType();
   }

   class="kw">public AudioComponent() {
   }

   class="kw">public AudioComponent(IntList var1) {
      this.soundEventIds = var1;
   }

   class="kw">public int[] getSoundEventIds() {
      class="kw">return this.soundEventIds.toIntArray();
   }

   class="kw">public void addSound(int var1) {
      this.soundEventIds.add(var1);
      this.isNetworkOutdated = true;
   }

   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 AudioComponent(new IntArrayList(this.soundEventIds));
   }
}