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