use of org.terasology.engine.rendering.nui.layers.ingame.DeathScreen in project Terasology by MovingBlocks.
the class MenuControlSystem method onPlayerDeath.
@ReceiveEvent(components = CharacterComponent.class)
public void onPlayerDeath(PlayerDeathEvent event, EntityRef character) {
EntityRef client = character.getComponent(CharacterComponent.class).controller;
if (client.getComponent(ClientComponent.class).local) {
nuiManager.removeOverlay("engine:onlinePlayersOverlay");
nuiManager.pushScreen("engine:deathScreen");
if (event.damageTypeName != null) {
((DeathScreen) nuiManager.getScreen("engine:deathScreen")).setDeathDetails(event.instigatorName, event.damageTypeName);
}
}
}
Aggregations