mirror of
https://github.com/Phoenix616/RandomTeleport.git
synced 2024-11-29 06:06:08 +01:00
Support listing players in a comma-separated list
This commit is contained in:
parent
f8a335a405
commit
b9c1f02e2e
@ -104,12 +104,14 @@ public class RandomTeleport extends JavaPlugin {
|
||||
if (args.length > 0) {
|
||||
List<Player> players = new ArrayList<>();
|
||||
for (String arg : args) {
|
||||
Player player = getServer().getPlayer(arg);
|
||||
for (String s : arg.split(",")) {
|
||||
Player player = getServer().getPlayer(s);
|
||||
if (player == null) {
|
||||
throw new PlayerNotFoundException(arg);
|
||||
throw new PlayerNotFoundException(s);
|
||||
}
|
||||
players.add(player);
|
||||
}
|
||||
}
|
||||
searcher.getTargets().addAll(players);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user