Merge pull request #273 from mverwijs/fix-spigot-utils-players

Fixes incompatibility where utils.players always returns [ ]
This commit is contained in:
Walter Higgins 2015-10-11 14:53:22 +01:00
commit e8895d77c0

View file

@ -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;
} }