Merge pull request #273 from mverwijs/fix-spigot-utils-players
Fixes incompatibility where utils.players always returns [ ]
This commit is contained in:
commit
e8895d77c0
1 changed files with 3 additions and 2 deletions
|
@ -610,8 +610,9 @@ This function returns a javascript array of player names (as javascript strings)
|
||||||
***/
|
***/
|
||||||
function getPlayersBukkit(){
|
function getPlayersBukkit(){
|
||||||
var result = [];
|
var result = [];
|
||||||
for (var i = 0; i < server.onlinePlayers.length; i++){
|
var players = server.getOnlinePlayers();
|
||||||
result.push(server.onlinePlayers[i]);
|
for (var i = 0; i < players.size(); i++){
|
||||||
|
result.push(players.get(i));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue