use of org.terasology.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.<Vector3i, Block>emptyMap(), supportRequired)) {
PrefabManager prefabManager = CoreRegistry.get(PrefabManager.class);
entity.send(new DestroyEvent(entity, EntityRef.NULL, prefabManager.getPrefab("engine:supportRemovedDamage")));
}
}
}
Aggregations