EntityTrackerUpdate class

Пакет: com.hypixel.hytale.server.core.modules.projectile.system

Файл: com/hypixel/hytale/server/core/modules/projectile/system/PredictedProjectileSystems.java

extends: EntityTickingSystem<EntityStore>

Поля (6)

МодификаторыТипИмя
private final ComponentType<EntityStore, PredictedProjectile> predictedProjectileComponentType
private final Query<EntityStore> query
PredictionUpdate var3
EntityTrackerSystems.Visible var6
PredictedProjectile var7
private final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType

Методы (5)

МодификаторыВозвратСигнатура
public SystemGroup<EntityStore> getGrouppublic SystemGroup<EntityStore> getGroup()
public Query<EntityStore> getQuerypublic Query<EntityStore> getQuery()
public boolean isParallelpublic boolean isParallel(int var1, int var2)
private static void queueUpdatesForprivate static void queueUpdatesFor(@Nonnull Ref<EntityStore> var0, @Nonnull PredictedProjectile var1, @Nonnull Map<Ref<EntityStore>, EntityTrackerSystems.EntityViewer> var2)
public void tickpublic void tick(float var1, int var2, @Nonnull ArchetypeChunk<EntityStore> var3, @Nonnull Store<EntityStore> var4, @Nonnull CommandBuffer<EntityStore> var5)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.projectile.system;

class="kw">import com.hypixel.hytale.component.ArchetypeChunk;
class="kw">import com.hypixel.hytale.component.CommandBuffer;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.component.SystemGroup;
class="kw">import com.hypixel.hytale.component.query.Query;
class="kw">import com.hypixel.hytale.component.system.tick.EntityTickingSystem;
class="kw">import com.hypixel.hytale.protocol.PredictionUpdate;
class="kw">import com.hypixel.hytale.server.core.modules.entity.tracker.EntityTrackerSystems;
class="kw">import com.hypixel.hytale.server.core.modules.projectile.component.PredictedProjectile;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.Map;
class="kw">import java.util.Map.Entry;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

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

   class="kw">public class="kw">static class EntityTrackerUpdate class="kw">extends EntityTickingSystem<EntityStore> {
      @Nonnull
      class="kw">private class="kw">final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType = EntityTrackerSystems.Visible.getComponentType();
      @Nonnull
      class="kw">private class="kw">final ComponentType<EntityStore, PredictedProjectile> predictedProjectileComponentType = PredictedProjectile.getComponentType();
      @Nonnull
      class="kw">private class="kw">final Query<EntityStore> query = Query.and(this.visibleComponentType, this.predictedProjectileComponentType);

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

      @Nullable
      @Override
      class="kw">public SystemGroup<EntityStore> getGroup() {
         class="kw">return EntityTrackerSystems.QUEUE_UPDATE_GROUP;
      }

      @Nonnull
      @Override
      class="kw">public Query<EntityStore> getQuery() {
         class="kw">return this.query;
      }

      @Override
      class="kw">public boolean isParallel(int var1, int var2) {
         class="kw">return EntityTickingSystem.maybeUseParallel(var1, var2);
      }

      @Override
      class="kw">public void tick(
         float var1, int var2, @Nonnull ArchetypeChunk<EntityStore> var3, @Nonnull Store<EntityStore> var4, @Nonnull CommandBuffer<EntityStore> var5
      ) {
         EntityTrackerSystems.Visible var6 = var3.getComponent(var2, this.visibleComponentType);
         assert var6 != null;
         PredictedProjectile var7 = var3.getComponent(var2, this.predictedProjectileComponentType);
         assert var7 != null;
         if (!var6.newlyVisibleTo.isEmpty()) {
            queueUpdatesFor(var3.getReferenceTo(var2), var7, var6.newlyVisibleTo);
         }
      }

      class="kw">private class="kw">static void queueUpdatesFor(
         @Nonnull Ref<EntityStore> var0, @Nonnull PredictedProjectile var1, @Nonnull Map<Ref<EntityStore>, EntityTrackerSystems.EntityViewer> var2
      ) {
         PredictionUpdate var3 = new PredictionUpdate(var1.getUuid());

         for (Entry var5 : var2.entrySet()) {
            var5.getValue().queueUpdate(var0, var3);
         }
      }
   }
}