Skip to content

Commit

Permalink
add world selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Aug 29, 2024
1 parent 4ccaa97 commit d18924a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ else if (selector.startsWith("@a")) {
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
.filter(player -> distance > player.getLocation().distance(standPoint))
.collect(Collectors.toList()));
}

else {
} else if (getArgument("world").length() != 0) {
String world = getArgument("world");
players.addAll(Bukkit.getOnlinePlayers().stream()
.filter(player -> player.getLocation().getWorld().getName().equals(world))
.collect(Collectors.toList()));
} else {
players.addAll(Bukkit.getOnlinePlayers().stream()
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
.collect(Collectors.toList()));
Expand Down

0 comments on commit d18924a

Please sign in to comment.