}
}
}
private void sendConsumableEvent(EntityRef entity, Event event, List<EventHandlerInfo> selectedHandlers) {
ConsumableEvent consumableEvent = (ConsumableEvent) event;
for (EventHandlerInfo handler : selectedHandlers) {
// Check isValid at each stage in case components were removed.
if (handler.isValidFor(entity)) {
handler.invoke(entity, event);
if (consumableEvent.isConsumed()) {
return;
}
}
}
}