Solved Please help I found a little glitch and I need help (QUICK HELP)

Discussion in 'Plugin Development' started by Look, Apr 25, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Look

    I am developing a plugin and I found this error:

    Code:
        private PacketStatusOutServerInfo constructPacket(PingReply reply) {
            GameProfile[] sample = new GameProfile[reply.getPlayerSample().size()];
            List<String> list = reply.getPlayerSample();
            for(int i = 0; i < list.size(); i++) {
                sample[i] = new GameProfile(UUID.randomUUID(), list.get(i));
            }
            ServerPingPlayerSample playerSample = new ServerPingPlayerSample(reply.getMaxPlayers(), reply.getOnlinePlayers());
            playerSample.a(sample);
            ServerPing ping = new ServerPing();
            ping.setMOTD(new ChatComponentText(reply.getMOTD()));
            ping.setPlayerSample(playerSample);
            ping.setServerInfo(new ServerPingServerData(reply.getProtocolName(), reply.getProtocolVersion()));
            ping.setFavicon(((CraftIconCache) reply.getIcon()).value);
            return new PacketStatusOutServerInfo(ping);
        }
    to be more specific, the error is right here inside that code ^:
    Code:
            for(int i = 0; i < list.size(); i++) {
                sample[i] = new GameProfile(UUID.randomUUID(), list.get(i));
            }
     
  2. Offline

    Gater12

    @Look
    And what error is it?
     
  3. Offline

    Look

    Code (Java):
    for(int i = 0; i < list.size(); i++) {
    sample = new GameProfile(UUID.randomUUID(), list.get(i));
    }


    Like, I need an alternative way to make that I just can't fix that error because eclipse doesn't know how to fix that error: http://prntscr.com/6y4tc0

    LOL nvm just fixed it... I forgot the .toString() after the UUID.randomUUID() :p But thank you =p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
Thread Status:
Not open for further replies.

Share This Page