Fixes incompatibility where utils.players is []
Using spigot 1.8.8, utils.players() always returns empty due to usage of deprecated calls. This fixes it on my machine, but not tested on other 'bukkit' servers.
This commit is contained in:
parent
e3079047a1
commit
5dd897aaa9
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(){
|
||||
var result = [];
|
||||
for (var i = 0; i < server.onlinePlayers.length; i++){
|
||||
result.push(server.onlinePlayers[i]);
|
||||
var players = server.getOnlinePlayers();
|
||||
for (var i = 0; i < players.size(); i++){
|
||||
result.push(players.get(i));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Reference in a new issue