From d18924ad11565790231d6b598bce8ef0a7820539 Mon Sep 17 00:00:00 2001 From: Mats Auraot <10709682+Mindgamesnl@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:47:51 +0200 Subject: [PATCH] add world selector --- .../modules/players/objects/SpigotPlayerSelector.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/com/craftmend/openaudiomc/spigot/modules/players/objects/SpigotPlayerSelector.java b/plugin/src/main/java/com/craftmend/openaudiomc/spigot/modules/players/objects/SpigotPlayerSelector.java index e6b3a726f..0944eec34 100644 --- a/plugin/src/main/java/com/craftmend/openaudiomc/spigot/modules/players/objects/SpigotPlayerSelector.java +++ b/plugin/src/main/java/com/craftmend/openaudiomc/spigot/modules/players/objects/SpigotPlayerSelector.java @@ -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()));