Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
implement World.getPlayers
Dieser Commit ist enthalten in:
Ursprung
d1e3d01036
Commit
df2c0e2308
@ -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;
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren