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.entity.Entity;
|
||||
import game.entity.npc.EntityNPC;
|
||||
import game.network.Player;
|
||||
|
@ -23,7 +26,13 @@ public class PlayerEntityListParser extends PlayerEntityParser {
|
|||
throw new RunException("Keine Spieler gefunden");
|
||||
return list;
|
||||
}
|
||||
return Lists.newArrayList((EntityNPC)super.parse(env, input));
|
||||
Set<EntityNPC> set = Sets.newHashSet();
|
||||
for(String tok : input.split(",", -1)) {
|
||||
set.add((EntityNPC)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