use of org.terasology.engine.entitySystem.event.PendingEvent in project Terasology by MovingBlocks.
the class EventSystemReplayImpl method originalSend.
// send method of EventSystemImpl
private void originalSend(EntityRef entity, Event event) {
if (Thread.currentThread() != mainThread) {
pendingEvents.offer(new PendingEvent(entity, event));
} else {
networkReplicate(entity, event);
Set<EventHandlerInfo> selectedHandlersSet = selectEventHandlers(event.getClass(), entity);
List<EventHandlerInfo> selectedHandlers = Lists.newArrayList(selectedHandlersSet);
selectedHandlers.sort(priorityComparator);
if (event instanceof ConsumableEvent) {
sendConsumableEvent(entity, event, selectedHandlers);
} else {
sendStandardEvent(entity, event, selectedHandlers);
}
}
}
Aggregations