Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPlayersOnServer(String::server name) seems to return Strings #35

Closed
irworks opened this issue Feb 14, 2016 · 0 comments
Closed

getPlayersOnServer(String::server name) seems to return Strings #35

irworks opened this issue Feb 14, 2016 · 0 comments

Comments

@irworks
Copy link

irworks commented Feb 14, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant