diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 8c9ead5570..554e3b784e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -721,16 +721,13 @@ public class CraftWorld implements World { } public List getPlayers() { - List list = new ArrayList(); + List list = new ArrayList(world.players.size()); - for (Object o : world.entityList) { - if (o instanceof net.minecraft.server.Entity) { - net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; - Entity bukkitEntity = mcEnt.getBukkitEntity(); + for (EntityHuman human : world.players) { + HumanEntity bukkitEntity = human.getBukkitEntity(); - if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) { - list.add((Player) bukkitEntity); - } + if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) { + list.add((Player) bukkitEntity); } }