Remove class

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

Файл: com/hypixel/hytale/server/core/modules/entityui/UIComponentSystems.java

extends: RefChangeSystem<EntityStore, UIComponentList>

Поля (3)

МодификаторыТипИмя
private final Query<EntityStore> query
private final ComponentType<EntityStore, UIComponentList> uiComponentListComponentType
private final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType

Методы (5)

МодификаторыВозвратСигнатура
public ComponentType<EntityStore, UIComponentList> componentTypepublic ComponentType<EntityStore, UIComponentList> componentType()
public Query<EntityStore> getQuerypublic Query<EntityStore> getQuery()
public void onComponentAddedpublic void onComponentAdded(@Nonnull Ref<EntityStore> var1, @Nonnull UIComponentList var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4)
public void onComponentRemovedpublic void onComponentRemoved(@Nonnull Ref<EntityStore> var1, @Nonnull UIComponentList var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4)
public void onComponentSetpublic void onComponentSet(@Nonnull Ref<EntityStore> var1, UIComponentList var2, @Nonnull UIComponentList var3, @Nonnull Store<EntityStore> var4, @Nonnull CommandBuffer<EntityStore> var5)

Исходный код

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

class="kw">import com.hypixel.hytale.component.AddReason;
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.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.SystemGroup;
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.RefChangeSystem;
class="kw">import com.hypixel.hytale.component.system.tick.EntityTickingSystem;
class="kw">import com.hypixel.hytale.protocol.ComponentUpdateType;
class="kw">import com.hypixel.hytale.protocol.UIComponentsUpdate;
class="kw">import com.hypixel.hytale.server.core.modules.entity.AllLegacyLivingEntityTypesQuery;
class="kw">import com.hypixel.hytale.server.core.modules.entity.tracker.EntityTrackerSystems;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.Map;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

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

   class="kw">public class="kw">static class Remove class="kw">extends RefChangeSystem<EntityStore, UIComponentList> {
      class="kw">private class="kw">final ComponentType<EntityStore, UIComponentList> uiComponentListComponentType;
      class="kw">private class="kw">final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType;
      @Nonnull
      class="kw">private class="kw">final Query<EntityStore> query;

      class="kw">public Remove(ComponentType<EntityStore, EntityTrackerSystems.Visible> var1, ComponentType<EntityStore, UIComponentList> var2) {
         this.visibleComponentType = var1;
         this.uiComponentListComponentType = var2;
         this.query = Query.and(var1, var2);
      }

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

      @Nonnull
      @Override
      class="kw">public ComponentType<EntityStore, UIComponentList> componentType() {
         class="kw">return this.uiComponentListComponentType;
      }

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

      class="kw">public void onComponentSet(
         @Nonnull Ref<EntityStore> var1,
         UIComponentList var2,
         @Nonnull UIComponentList var3,
         @Nonnull Store<EntityStore> var4,
         @Nonnull CommandBuffer<EntityStore> var5
      ) {
      }

      class="kw">public void onComponentRemoved(
         @Nonnull Ref<EntityStore> var1, @Nonnull UIComponentList var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
      ) {
         for (EntityTrackerSystems.EntityViewer var6 : var3.getComponent(var1, this.visibleComponentType).visibleTo.values()) {
            var6.queueRemove(var1, ComponentUpdateType.UIComponents);
         }
      }
   }

   class="kw">public class="kw">static class Setup class="kw">extends HolderSystem<EntityStore> {
      class="kw">private class="kw">final ComponentType<EntityStore, UIComponentList> uiComponentListComponentType;

      class="kw">public Setup(ComponentType<EntityStore, UIComponentList> var1) {
         this.uiComponentListComponentType = var1;
      }

      @Override
      class="kw">public void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) {
         UIComponentList var4 = var1.getComponent(this.uiComponentListComponentType);
         if (var4 == null) {
            var4 = var1.ensureAndGetComponent(this.uiComponentListComponentType);
            var4.update();
         }
      }

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

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

   class="kw">public class="kw">static class Update class="kw">extends EntityTickingSystem<EntityStore> {
      class="kw">private class="kw">final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType;
      class="kw">private class="kw">final ComponentType<EntityStore, UIComponentList> uiComponentListComponentType;
      @Nonnull
      class="kw">private class="kw">final Query<EntityStore> query;

      class="kw">public Update(ComponentType<EntityStore, EntityTrackerSystems.Visible> var1, ComponentType<EntityStore, UIComponentList> var2) {
         this.visibleComponentType = var1;
         this.uiComponentListComponentType = var2;
         this.query = Query.and(var1, var2);
      }

      @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);
         UIComponentList var7 = var3.getComponent(var2, this.uiComponentListComponentType);
         if (!var6.newlyVisibleTo.isEmpty()) {
            queueUpdatesFor(var3.getReferenceTo(var2), var7, var6.newlyVisibleTo);
         }
      }

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

         for (EntityTrackerSystems.EntityViewer var5 : var2.values()) {
            var5.queueUpdate(var0, var3);
         }
      }
   }
}