EntityDeath class
Пакет: com.hypixel.hytale.server.flock
Файл: com/hypixel/hytale/server/flock/FlockDeathSystems.java
extends: DeathSystems.OnDeathSystem
Поля (7)
| Модификаторы | Тип | Имя |
|---|---|---|
|
private final Query<EntityStore> |
query |
|
Damage |
var10 |
|
Flock |
var11 |
|
NPCEntity |
var5 |
|
Role |
var6 |
|
Ref |
var7 |
|
|
var7 |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public Query<EntityStore> |
getQuerypublic Query<EntityStore> getQuery() |
|
|
if if(var5 != null) |
|
|
if if(var7 != null) |
|
|
if if(var11 != null) |
|
public void |
onComponentAddedpublic void onComponentAdded(@Nonnull Ref<EntityStore> var1, @Nonnull DeathComponent var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.flock;
class="kw">import com.hypixel.hytale.component.CommandBuffer;
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.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.modules.entity.AllLegacyLivingEntityTypesQuery;
class="kw">import com.hypixel.hytale.server.core.modules.entity.damage.Damage;
class="kw">import com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent;
class="kw">import com.hypixel.hytale.server.core.modules.entity.damage.DeathSystems;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import com.hypixel.hytale.server.npc.entities.NPCEntity;
class="kw">import com.hypixel.hytale.server.npc.role.Role;
class="kw">import javax.annotation.Nonnull;
class="kw">public class FlockDeathSystems {
class="kw">public FlockDeathSystems() {
}
class="kw">public class="kw">static class EntityDeath class="kw">extends DeathSystems.OnDeathSystem {
@Nonnull
class="kw">private class="kw">final Query<EntityStore> query = Query.and(AllLegacyLivingEntityTypesQuery.INSTANCE, Query.not(Player.getComponentType()));
class="kw">public EntityDeath() {
}
@Nonnull
@Override
class="kw">public Query<EntityStore> getQuery() {
class="kw">return this.query;
}
class="kw">public void onComponentAdded(
@Nonnull Ref<EntityStore> var1, @Nonnull DeathComponent var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
NPCEntity var5 = var4.getComponent(var1, NPCEntity.getComponentType());
if (var5 != null) {
Role var6 = var5.getRole();
if (var6 != null && !var6.isCorpseStaysInFlock()) {
var4.tryRemoveComponent(var1, FlockMembership.getComponentType());
}
}
Damage var10 = var2.getDeathInfo();
Ref var7 = null;
if (var10 != null && var10.getSource() class="kw">instanceof Damage.EntitySource var8) {
var7 = var8.getRef();
}
if (var7 != null) {
Flock var11 = FlockPlugin.getFlock(var4, var7);
if (var11 != null) {
var11.onTargetKilled(var4, var1);
}
}
}
}
class="kw">public class="kw">static class PlayerDeath class="kw">extends DeathSystems.OnDeathSystem {
class="kw">public PlayerDeath() {
}
@Nonnull
@Override
class="kw">public Query<EntityStore> getQuery() {
class="kw">return Player.getComponentType();
}
class="kw">public void onComponentAdded(
@Nonnull Ref<EntityStore> var1, @Nonnull DeathComponent var2, @Nonnull Store<EntityStore> var3, @Nonnull CommandBuffer<EntityStore> var4
) {
var4.tryRemoveComponent(var1, FlockMembership.getComponentType());
}
}
}