ServerPlayerListSystems class

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

Файл: com/hypixel/hytale/server/core/modules/serverplayerlist/ServerPlayerListSystems.java

Поля (2)

МодификаторыТипИмя
private final ComponentType<EntityStore, Spectating> spectatingComponentType
PlayerRef var3

Методы (10)

МодификаторыВозвратСигнатура
public OnSpectatingChangepublic OnSpectatingChange()
private static void broadcastprivate static void broadcast(@Nonnull Ref<EntityStore> var0, boolean var1, @Nonnull CommandBuffer<EntityStore> var2)
abstract broadcast broadcast(var1, true, var4)
abstract broadcast broadcast(var1, false, var4)
public ComponentType<EntityStore, Spectating> componentTypepublic ComponentType<EntityStore, Spectating> componentType()
public Query<EntityStore> getQuerypublic Query<EntityStore> getQuery()
if if(var3 != null)
public void onComponentAddedpublic void onComponentAdded(@Nonnull Ref<EntityStore> var1, @Nonnull Spectating var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4)
public void onComponentRemovedpublic void onComponentRemoved(@Nonnull Ref<EntityStore> var1, @Nonnull Spectating var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4)
public void onComponentSetpublic void onComponentSet(@Nonnull Ref<EntityStore> var1, Spectating var2, @Nonnull Spectating var3, @Nonnull Store<EntityStore> var4, @Nonnull CommandBuffer<EntityStore> var5)

Исходный код

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

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.query.Query;
class="kw">import com.hypixel.hytale.component.system.RefChangeSystem;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.Spectating;
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 ServerPlayerListSystems {
   class="kw">public ServerPlayerListSystems() {
   }

   class="kw">public class="kw">static class OnSpectatingChange class="kw">extends RefChangeSystem<EntityStore, Spectating> {
      class="kw">private class="kw">final ComponentType<EntityStore, Spectating> spectatingComponentType = Spectating.getComponentType();

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

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

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

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

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

      class="kw">public void onComponentRemoved(
         @Nonnull Ref<EntityStore> var1, @Nonnull Spectating var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
      ) {
         broadcast(var1, false, var4);
      }

      class="kw">private class="kw">static void broadcast(@Nonnull Ref<EntityStore> var0, boolean var1, @Nonnull CommandBuffer<EntityStore> var2) {
         PlayerRef var3 = var2.getComponent(var0, PlayerRef.getComponentType());
         if (var3 != null) {
            ServerPlayerListModule.get().broadcastListEntry(var3, var1);
         }
      }
   }
}