ObjectivePlayerSetupSystem class
Пакет: com.hypixel.hytale.builtin.adventure.objectives.systems
Файл: com/hypixel/hytale/builtin/adventure/objectives/systems/ObjectivePlayerSetupSystem.java
extends: RefSystem<EntityStore>
Поля (12)
| Модификаторы | Тип | Имя |
|---|---|---|
|
Set |
var10 |
|
PlayerWorldData |
var13 |
|
ObjectiveGameplayConfig |
var14 |
|
Map |
var15 |
|
String |
var16 |
|
World |
var17 |
|
String |
var18 |
|
Player |
var5 |
|
UUIDComponent |
var6 |
|
ObjectivePlugin |
var7 |
|
UUID |
var8 |
|
PlayerConfigData |
var9 |
Методы (4)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
for for(UUID var12 : var10) |
|
|
if if(var10 != null) |
|
|
if if(var15 != null) |
|
|
if if(var16 != null) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.objectives.systems;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.ObjectivePlugin;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.components.ObjectiveHistoryComponent;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.config.gameplayconfig.ObjectiveGameplayConfig;
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.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.RefSystem;
class="kw">import com.hypixel.hytale.server.core.entity.UUIDComponent;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.data.PlayerConfigData;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.data.PlayerWorldData;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.Map;
class="kw">import java.util.Set;
class="kw">import java.util.UUID;
class="kw">import javax.annotation.Nonnull;
class="kw">public class ObjectivePlayerSetupSystem class="kw">extends RefSystem<EntityStore> {
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, ObjectiveHistoryComponent> objectiveHistoryComponentType;
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, Player> playerComponentType;
@Nonnull
class="kw">private class="kw">final ComponentType<EntityStore, UUIDComponent> uuidComponentType = UUIDComponent.getComponentType();
@Nonnull
class="kw">private class="kw">final Query<EntityStore> query;
class="kw">public ObjectivePlayerSetupSystem(@Nonnull ComponentType<EntityStore, ObjectiveHistoryComponent> var1, @Nonnull ComponentType<EntityStore, Player> var2) {
this.objectiveHistoryComponentType = var1;
this.playerComponentType = var2;
this.query = Query.and(var2, this.uuidComponentType);
}
@Nonnull
@Override
class="kw">public Query<EntityStore> getQuery() {
class="kw">return this.query;
}
@Override
class="kw">public void onEntityAdded(
@Nonnull Ref<EntityStore> var1, @Nonnull AddReason var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
var4.ensureComponent(var1, this.objectiveHistoryComponentType);
Player var5 = var3.getComponent(var1, this.playerComponentType);
assert var5 != null;
UUIDComponent var6 = var3.getComponent(var1, this.uuidComponentType);
assert var6 != null;
ObjectivePlugin var7 = ObjectivePlugin.get();
UUID var8 = var6.getUuid();
PlayerConfigData var9 = var5.getPlayerConfigData();
Set var10 = var9.getActiveObjectiveUUIDs();
if (var10 != null) {
for (UUID var12 : var10) {
var7.addPlayerToExistingObjective(var3, var8, var12);
}
}
World var17 = var3.getExternalData().getWorld();
String var18 = var17.getName();
PlayerWorldData var13 = var9.getPerWorldData(var18);
if (var13.isFirstSpawn()) {
ObjectiveGameplayConfig var14 = ObjectiveGameplayConfig.get(var17.getGameplayConfig());
Map var15 = var14 != null ? var14.getStarterObjectiveLinePerWorld() : null;
if (var15 != null) {
String var16 = var15.get(var18);
if (var16 != null) {
var7.startObjectiveLine(var3, var16, Set.of(var8), var17.getWorldConfig().getUuid(), null);
}
}
}
}
@Override
class="kw">public void onEntityRemove(
@Nonnull Ref<EntityStore> var1, @Nonnull RemoveReason var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
}
}