PostAssignmentSystem class

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

Файл: com/hypixel/hytale/server/core/modules/entity/player/PlayerMovementManagerSystems.java

extends: RefSystem<EntityStore>

Поля (3)

МодификаторыТипИмя
private static final ComponentType<EntityStore, MovementManager> MOVEMENT_MANAGER_COMPONENT_TYPE
private static final Query<EntityStore> QUERY
MovementManager var5

Методы (3)

МодификаторыВозвратСигнатура
public Query<EntityStore> getQuerypublic Query<EntityStore> getQuery()
public void onEntityAddedpublic void onEntityAdded(@Nonnull Ref<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4)
public void onEntityRemovepublic void onEntityRemove(@Nonnull Ref<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4)

Исходный код

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

class="kw">import com.hypixel.hytale.component.AddReason;
class="kw">import com.hypixel.hytale.component.CommandBuffer;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.RemoveReason;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.component.query.Query;
class="kw">import com.hypixel.hytale.component.system.HolderSystem;
class="kw">import com.hypixel.hytale.component.system.RefSystem;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.movement.MovementManager;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;

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

   class="kw">public class="kw">static class AssignmentSystem class="kw">extends HolderSystem<EntityStore> {
      @Nonnull
      class="kw">private class="kw">static class="kw">final ComponentType<EntityStore, MovementManager> MOVEMENT_MANAGER_COMPONENT_TYPE = MovementManager.getComponentType();
      @Nonnull
      class="kw">private class="kw">static class="kw">final Query<EntityStore> QUERY = Query.and(PlayerRef.getComponentType(), Query.not(MOVEMENT_MANAGER_COMPONENT_TYPE));

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

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

      @Override
      class="kw">public void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) {
         var1.ensureComponent(MOVEMENT_MANAGER_COMPONENT_TYPE);
      }

      @Override
      class="kw">public void onEntityRemoved(@Nonnull Holder<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3) {
      }
   }

   class="kw">public class="kw">static class PostAssignmentSystem class="kw">extends RefSystem<EntityStore> {
      @Nonnull
      class="kw">private class="kw">static class="kw">final ComponentType<EntityStore, MovementManager> MOVEMENT_MANAGER_COMPONENT_TYPE = MovementManager.getComponentType();
      @Nonnull
      class="kw">private class="kw">static class="kw">final Query<EntityStore> QUERY = Query.and(MOVEMENT_MANAGER_COMPONENT_TYPE, PlayerRef.getComponentType());

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

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

      @Override
      class="kw">public void onEntityAdded(
         @Nonnull Ref<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
      ) {
         MovementManager var5 = var4.getComponent(var1, MOVEMENT_MANAGER_COMPONENT_TYPE);
         assert var5 != null;
         var5.resetDefaultsAndUpdate(var1, var4);
      }

      @Override
      class="kw">public void onEntityRemove(
         @Nonnull Ref<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
      ) {
      }
   }
}