SpawnBeaconCheckRemovalSystem class
Пакет: com.hypixel.hytale.builtin.adventure.npcobjectives.systems
Файл: com/hypixel/hytale/builtin/adventure/npcobjectives/systems/SpawnBeaconCheckRemovalSystem.java
extends: HolderSystem<EntityStore>
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
|
LegacySpawnBeaconEntity |
var4 |
|
UUID |
var5 |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.npcobjectives.systems;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.ObjectivePlugin;
class="kw">import com.hypixel.hytale.component.AddReason;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Holder;
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.server.core.universe.world.storage.EntityStore;
class="kw">import com.hypixel.hytale.server.spawning.beacons.LegacySpawnBeaconEntity;
class="kw">import java.util.UUID;
class="kw">import javax.annotation.Nonnull;
class="kw">public class SpawnBeaconCheckRemovalSystem class="kw">extends HolderSystem<EntityStore> {
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, LegacySpawnBeaconEntity> legacySpawnBeaconEntityComponentType;
class="kw">public SpawnBeaconCheckRemovalSystem(@Nonnull ComponentType<EntityStore, LegacySpawnBeaconEntity> var1) {
this.legacySpawnBeaconEntityComponentType = var1;
}
@Nonnull
@Override
class="kw">public Query<EntityStore> getQuery() {
class="kw">return this.legacySpawnBeaconEntityComponentType;
}
@Override
class="kw">public void onEntityAdd(@Nonnull Holder<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3) {
LegacySpawnBeaconEntity var4 = var1.getComponent(this.legacySpawnBeaconEntityComponentType);
assert var4 != null;
UUID var5 = var4.getObjectiveUUID();
if (var5 != null && ObjectivePlugin.get().getObjectiveDataStore().getObjective(var5) == null) {
var4.remove();
}
}
@Override
class="kw">public void onEntityRemoved(@Nonnull Holder<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3) {
}
}