3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Clean up World.getPlayers().

Original idea from CyberTiger, PR #150
Dieser Commit ist enthalten in:
md_5 2015-06-27 15:46:19 +10:00
Ursprung c9c233b796
Commit 76c834a849

Datei anzeigen

@ -721,16 +721,13 @@ 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);
}
if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) {
list.add((Player) bukkitEntity);
}
}