Bug in utils.js ?
tjhgit opened this issue ยท 3 comments
I have spigot version 1.8.8
I had to modify utils.js for getPlayers() to work properly.
function getPlayersBukkit(){
var result = [];
//var players_collection = server.getOnlinePlayers();
//var players = players_collection.toArray(new org.bukkit.entity.Player[players_collection.size()]);
var players = server.getOnlinePlayers();
//for (var i = 0; i < players.size(); i++){
// result.push(players.get(i));
//}
//result.push(players[0]);
// I HAD TO CORRECT THIS CODE since size() does not exist
for (var i = 0; i < players.length; i++){
result.push(players[i]);
}
return result;
}
I've checked this with Spigot 1.9 and Java 8. I can't reproduce this issue. Can you try upgrading to Spigot 1.9 ?