use of org.terasology.engine.logic.health.DestroyEvent in project Terasology by MovingBlocks.
the class SideBlockSupportRequired method checkForSupport.
@ReceiveEvent
public void checkForSupport(DelayedActionTriggeredEvent event, EntityRef entity, BlockComponent block, SideBlockSupportRequiredComponent supportRequired) {
if (event.getActionId().equals(SUPPORT_CHECK_ACTION_ID)) {
if (!isSufficientlySupported(block.getPosition(), null, Collections.emptyMap(), supportRequired)) {
PrefabManager prefabManager = CoreRegistry.get(PrefabManager.class);
entity.send(new DestroyEvent(entity, EntityRef.NULL, prefabManager.getPrefab("engine" + ":supportRemovedDamage")));
}
}
}
use of org.terasology.engine.logic.health.DestroyEvent in project Anatomy by Terasology.
the class CirculatoryEffectsSystem method onBloodLevelChanged.
@ReceiveEvent
public void onBloodLevelChanged(BloodLevelChangedEvent event, EntityRef entityRef, InjuredCirculatoryComponent injuredCirculatoryComponent) {
if (injuredCirculatoryComponent.bloodLevel <= 0) {
Prefab bloodLossDamage = prefabManager.getPrefab("Anatomy:bloodLoss");
entityRef.send(new DestroyEvent(EntityRef.NULL, EntityRef.NULL, bloodLossDamage));
}
}
Aggregations