mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +01:00
implement World.getPlayers
This commit is contained in:
parent
d1e3d01036
commit
df2c0e2308
@ -448,4 +448,21 @@ public class CraftWorld implements World {
|
|||||||
|
|
||||||
return list;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user