while (connection == null || connection.world == null) {
while (connection.world == null) {
    public World receiveWorld() throws IOException {	World w;	synchronized (clientSemaphore) {	    while (connection == null ||		    connection.world == null) {		try {		    clientSemaphore.wait();		} catch (InterruptedException e) {		    // do nothing		}	    }	}        System.out.println("World received from server");	return connection.world;    }