use of org.terasology.network.NetworkEvent in project Terasology by MovingBlocks.
the class EventSystemImpl method broadcastEvent.
private void broadcastEvent(EntityRef entity, Event event, EventMetadata metadata) {
if (networkSystem.getMode().isServer()) {
NetworkComponent netComp = entity.getComponent(NetworkComponent.class);
BlockComponent blockComp = entity.getComponent(BlockComponent.class);
if (netComp != null || blockComp != null) {
Client instigatorClient = null;
if (metadata.isSkipInstigator() && event instanceof NetworkEvent) {
instigatorClient = networkSystem.getOwner(((NetworkEvent) event).getInstigator());
}
for (Client client : networkSystem.getPlayers()) {
if (!client.equals(instigatorClient)) {
client.send(event, entity);
}
}
}
}
}
Aggregations