mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 02:47:44 +01:00
parent
c9c233b796
commit
76c834a849
@ -721,18 +721,15 @@ public class CraftWorld implements World {
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
List<Player> list = new ArrayList<Player>();
|
||||
List<Player> list = new ArrayList<Player>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user