return false;
}
@ReceiveEvent(components = ClientComponent.class)
public void onConnect(ConnectedEvent connected, EntityRef entity) {
LocationComponent loc = entity.getComponent(LocationComponent.class);
loc.setWorldPosition(connected.getPlayerStore().getRelevanceLocation());
entity.saveComponent(loc);
addRelevanceEntity(entity, ViewDistance.LEGALLY_BLIND.getChunkDistance(), networkSystem.getOwner(entity));
if (connected.getPlayerStore().hasCharacter()) {
if (worldProvider.isBlockRelevant(connected.getPlayerStore().getRelevanceLocation())) {
restoreCharacter(entity, connected.getPlayerStore());
} else {
SpawningClientInfo spawningClientInfo = new SpawningClientInfo(entity, connected.getPlayerStore().getRelevanceLocation(), connected.getPlayerStore());
clientsPreparingToSpawn.add(spawningClientInfo);
}
} else {
Vector3i pos = Vector3i.zero();
if (worldProvider.isBlockRelevant(pos)) {
spawnPlayer(entity, getSafeSpawnPosition());
} else {
// Move the player (before it's spawned) to the spawn-position to make sure the relevance
// loads the chunk at some point
Vector3f spawnPosition = getSafeSpawnPosition().toVector3f();
loc.setWorldPosition(spawnPosition);
entity.saveComponent(loc);
SpawningClientInfo spawningClientInfo = new SpawningClientInfo(entity,
spawnPosition);
clientsPreparingToSpawn.add(spawningClientInfo);