diff options
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 9058a580..6b68b9cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -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; + } } |