DynamicLightSystems class
Пакет: com.hypixel.hytale.server.core.modules.entity.dynamiclight
Файл: com/hypixel/hytale/server/core/modules/entity/dynamiclight/DynamicLightSystems.java
Поля (6)
| Модификаторы | Тип | Имя |
|---|---|---|
|
private final ComponentType<EntityStore, DynamicLight> |
dynamicLightComponentType |
|
private final ComponentType<EntityStore, PersistentDynamicLight> |
persistentDynamicLightComponentType |
|
private final Query<EntityStore> |
query |
|
PersistentDynamicLight |
var4 |
|
EntityTrackerSystems.Visible |
var5 |
|
private final ComponentType<EntityStore, EntityTrackerSystems.Visible> |
visibleComponentType |
Методы (11)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public |
EntityTrackerRemovepublic EntityTrackerRemove(ComponentType<EntityStore, EntityTrackerSystems.Visible> var1) |
|
public |
Setuppublic Setup() |
|
public ComponentType<EntityStore, DynamicLight> |
componentTypepublic ComponentType<EntityStore, DynamicLight> componentType() |
|
public Query<EntityStore> |
getQuerypublic Query<EntityStore> getQuery() |
|
public Query<EntityStore> |
getQuerypublic Query<EntityStore> getQuery() |
|
|
if if(var5 != null) |
|
public void |
onComponentAddedpublic void onComponentAdded(@Nonnull Ref<EntityStore> var1, @Nonnull DynamicLight var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4) |
|
public void |
onComponentRemovedpublic void onComponentRemoved(@Nonnull Ref<EntityStore> var1, @Nonnull DynamicLight var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4) |
|
public void |
onComponentSetpublic void onComponentSet(@Nonnull Ref<EntityStore> var1,
DynamicLight var2,
@Nonnull DynamicLight var3,
@Nonnull Store<EntityStore> var4,
@Nonnull CommandBuffer<EntityStore> var5) |
|
public void |
onEntityAddpublic void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) |
|
public void |
onEntityRemovedpublic void onEntityRemoved(@Nonnull Holder<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.entity.dynamiclight;
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.RefChangeSystem;
class="kw">import com.hypixel.hytale.protocol.ComponentUpdateType;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.DynamicLight;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.PersistentDynamicLight;
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 javax.annotation.Nonnull;
class="kw">public class DynamicLightSystems {
class="kw">public DynamicLightSystems() {
}
class="kw">public class="kw">static class EntityTrackerRemove class="kw">extends RefChangeSystem<EntityStore, DynamicLight> {
class="kw">private class="kw">final ComponentType<EntityStore, EntityTrackerSystems.Visible> visibleComponentType;
class="kw">public EntityTrackerRemove(ComponentType<EntityStore, EntityTrackerSystems.Visible> var1) {
this.visibleComponentType = var1;
}
@Nonnull
@Override
class="kw">public Query<EntityStore> getQuery() {
class="kw">return this.visibleComponentType;
}
@Nonnull
@Override
class="kw">public ComponentType<EntityStore, DynamicLight> componentType() {
class="kw">return DynamicLight.getComponentType();
}
class="kw">public void onComponentAdded(
@Nonnull Ref<EntityStore> var1, @Nonnull DynamicLight var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
}
class="kw">public void onComponentSet(
@Nonnull Ref<EntityStore> var1,
DynamicLight var2,
@Nonnull DynamicLight var3,
@Nonnull Store<EntityStore> var4,
@Nonnull CommandBuffer<EntityStore> var5
) {
}
class="kw">public void onComponentRemoved(
@Nonnull Ref<EntityStore> var1, @Nonnull DynamicLight var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
EntityTrackerSystems.Visible var5 = var4.getComponent(var1, this.visibleComponentType);
if (var5 != null) {
for (EntityTrackerSystems.EntityViewer var7 : var5.visibleTo.values()) {
var7.queueRemove(var1, ComponentUpdateType.DynamicLight);
}
}
}
}
class="kw">public class="kw">static class Setup class="kw">extends HolderSystem<EntityStore> {
class="kw">private class="kw">final ComponentType<EntityStore, DynamicLight> dynamicLightComponentType = DynamicLight.getComponentType();
class="kw">private class="kw">final ComponentType<EntityStore, PersistentDynamicLight> persistentDynamicLightComponentType = PersistentDynamicLight.getComponentType();
class="kw">private class="kw">final Query<EntityStore> query = Query.and(this.persistentDynamicLightComponentType, Query.not(this.dynamicLightComponentType));
class="kw">public Setup() {
}
@Override
class="kw">public void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) {
PersistentDynamicLight var4 = var1.getComponent(this.persistentDynamicLightComponentType);
var1.putComponent(this.dynamicLightComponentType, new DynamicLight(var4.getColorLight()));
}
@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 this.query;
}
}
}