It seems that getApi().getPlayersOnServer(String::server name) does not return a real UUID Set. Iterating through the Set causes an java.lang.ClassCastException: java.lang.String cannot be cast to java.util.UUID Exception.
Code example:
List<UUID> playerstosend = new ArrayList<>(); playerstosend.addAll(Main.getInstance().getProxy().getApi().getPlayersOnServer(player.getServer().getInfo().getName()));
for (UUID tosend : playerstosend) { //and here we get our exception
...
It's also interesting that getApi().getPlayersOnline() does work perfectly fine, so the workaround iterating through all players and removing which serverInfo does not match to the requested one.
It seems that
getApi().getPlayersOnServer(String::server name)
does not return a real UUID Set. Iterating through the Set causes an java.lang.ClassCastException: java.lang.String cannot be cast to java.util.UUID Exception.Code example:
It's also interesting that
getApi().getPlayersOnline()
does work perfectly fine, so the workaround iterating through all players and removing which serverInfo does not match to the requested one.