diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 9058a580aa..6b68b9cc3e 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 getPlayers() { + List list = new ArrayList(); + + 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; + } }