command entities
This commit is contained in:
parent
e88958e2f4
commit
460a58e062
32 changed files with 293 additions and 37 deletions
|
@ -2,7 +2,10 @@ package game.command;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import game.collect.Lists;
|
||||
import game.collect.Sets;
|
||||
import game.network.Player;
|
||||
|
||||
public class PlayerListParser extends PlayerParser {
|
||||
|
@ -16,7 +19,13 @@ public class PlayerListParser extends PlayerParser {
|
|||
throw new RunException("Keine Spieler gefunden");
|
||||
return Lists.newArrayList(env.getServer().getPlayers());
|
||||
}
|
||||
return Lists.newArrayList((Player)super.parse(env, input));
|
||||
Set<Player> set = Sets.newHashSet();
|
||||
for(String tok : input.split(",", -1)) {
|
||||
set.add((Player)super.parse(env, tok));
|
||||
}
|
||||
if(set.isEmpty())
|
||||
throw new RunException("Keine Spieler gefunden");
|
||||
return Lists.newArrayList(set);
|
||||
}
|
||||
|
||||
public Object getDefault(CommandEnvironment env) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue