3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

implement World.getPlayers

Dieser Commit ist enthalten in:
Tanel Suurhans 2011-02-24 21:37:53 +02:00 committet von Dinnerbone
Ursprung d1e3d01036
Commit df2c0e2308

Datei anzeigen

@ -448,4 +448,21 @@ public class CraftWorld implements World {
return list;
}
public List<Player> getPlayers() {
List<Player> list = new ArrayList<Player>();
for (Object o : world.b) {
if (o instanceof net.minecraft.server.Entity) {
net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity)o;
Entity bukkitEntity = mcEnt.getBukkitEntity();
if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) {
list.add((Player)bukkitEntity);
}
}
}
return list;
}
}