예제 #1
0
파일: World.java 프로젝트: lare96/luna
 /** Retrieves a player by their username. */
 public Optional<Player> getPlayer(String username) {
   return playerList.findFirst(player -> player.getUsername().equals(username));
 }
예제 #2
0
파일: World.java 프로젝트: lare96/luna
 /** Retrieves a player by their username hash. Faster than {@code getPlayer(String)}. */
 public Optional<Player> getPlayer(long username) {
   return playerList.findFirst(player -> player.getUsernameHash() == username);
 }