private static Location initLocation ( GlowSession session , PlayerReader reader ) { if ( reader . hasPlayedBefore ( ) ) { Location loc = reader . getLocation ( ) ; if ( loc != null ) { return loc ; } } return session . getServer ( ) . getWorlds ( ) . get ( 0 ) . getSpawnLocation ( ) ; }
Read the location from a PlayerReader for entity initialization . Will fall back to a reasonable default rather than returning null .