EntityTrackerRemove class
Пакет: com.hypixel.hytale.server.core.entity.nameplate
Файл: com/hypixel/hytale/server/core/entity/nameplate/NameplateSystems.java
extends: RefChangeSystem<EntityStore, Nameplate>
Поля (4)
| Модификаторы | Тип | Имя |
|---|---|---|
|
private final ComponentType<EntityStore, Nameplate> |
componentType |
|
private final Query<EntityStore> |
query |
|
EntityTrackerSystems.Visible |
var5 |
|
private final ComponentType<EntityStore, EntityTrackerSystems.Visible> |
visibleComponentType |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public ComponentType<EntityStore, Nameplate> |
componentTypepublic ComponentType<EntityStore, Nameplate> componentType() |
|
public Query<EntityStore> |
getQuerypublic Query<EntityStore> getQuery() |
|
public void |
onComponentAddedpublic void onComponentAdded(@Nonnull Ref<EntityStore> var1, @Nonnull Nameplate var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4) |
|
public void |
onComponentRemovedpublic void onComponentRemoved(@Nonnull Ref<EntityStore> var1, @Nonnull Nameplate var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4) |
|
public void |
onComponentSetpublic void onComponentSet(@Nonnull Ref<EntityStore> var1, Nameplate var2, @Nonnull Nameplate var3, @Nonnull Store<EntityStore> var4, @Nonnull CommandBuffer<EntityStore> var5) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.entity.nameplate;
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.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.NameplateUpdate;
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 NameplateSystems {
class="kw">public NameplateSystems() {
}
class="kw">public class="kw">static class EntityTrackerRemove class="kw">extends RefChangeSystem<EntityStore, Nameplate> {
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, Nameplate> componentType;
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType;
@Nonnull
class="kw">private class="kw">final Query<EntityStore> query;
class="kw">public EntityTrackerRemove(@Nonnull ComponentType<EntityStore, EntityTrackerSystems.Visible> var1, @Nonnull ComponentType<EntityStore, Nameplate> var2) {
this.visibleComponentType = var1;
this.componentType = 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, Nameplate> componentType() {
class="kw">return this.componentType;
}
class="kw">public void onComponentAdded(
@Nonnull Ref<EntityStore> var1, @Nonnull Nameplate var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
}
class="kw">public void onComponentSet(
@Nonnull Ref<EntityStore> var1, Nameplate var2, @Nonnull Nameplate var3, @Nonnull Store<EntityStore> var4, @Nonnull CommandBuffer<EntityStore> var5
) {
}
class="kw">public void onComponentRemoved(
@Nonnull Ref<EntityStore> var1, @Nonnull Nameplate var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
EntityTrackerSystems.Visible var5 = var3.getComponent(var1, this.visibleComponentType);
assert var5 != null;
for (EntityTrackerSystems.EntityViewer var7 : var5.visibleTo.values()) {
var7.queueRemove(var1, ComponentUpdateType.Nameplate);
}
}
}
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;
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, Nameplate> componentType;
@Nonnull
class="kw">private class="kw">final Query<EntityStore> query;
class="kw">public EntityTrackerUpdate(@Nonnull ComponentType<EntityStore, EntityTrackerSystems.Visible> var1, @Nonnull ComponentType<EntityStore, Nameplate> var2) {
this.visibleComponentType = var1;
this.componentType = 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);
assert var6 != null;
Nameplate var7 = var3.getComponent(var2, this.componentType);
assert var7 != null;
if (var7.consumeNetworkOutdated()) {
queueUpdatesFor(var3.getReferenceTo(var2), var7, var6.visibleTo);
} else if (!var6.newlyVisibleTo.isEmpty()) {
queueUpdatesFor(var3.getReferenceTo(var2), var7, var6.newlyVisibleTo);
}
}
class="kw">private class="kw">static void queueUpdatesFor(
@Nonnull Ref<EntityStore> var0, @Nonnull Nameplate var1, @Nonnull Map<Ref<EntityStore>, EntityTrackerSystems.EntityViewer> var2
) {
NameplateUpdate var3 = new NameplateUpdate(var1.getText());
for (EntityTrackerSystems.EntityViewer var5 : var2.values()) {
var5.queueUpdate(var0, var3);
}
}
}
}