.hasNext and .next error

Discussion in 'Plugin Development' started by robin2310, Aug 4, 2015.

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

    robin2310

    Hello again.
    I have some errors.
    I'll show you:
    Code:
     public void updateScoreboards()
      {
        for (Iterator<UUID> localIterator1 = this.players.iterator(); localIterator1.hasNext(); ???.hasNext())
        {
          UUID u = (UUID)localIterator1.next();
          Player p = Bukkit.getServer().getPlayer(u);
          p.getScoreboard().getObjective(DisplaySlot.SIDEBAR).setDisplayName(MessagesConfig.getScoreTitle(this.name, getTimeString()));
          for (String ent : p.getScoreboard().getEntries()) {
            p.getScoreboard().resetScores(ent);
          }
          ??? = this.player.iterator();continue;UUID i = (UUID)???.next();
          Player s = Bukkit.getServer().getPlayer(i);
          if ((((Integer)this.lives.get(i)).intValue() == 0) && ((this.stage.equals(GameStage.INGAME)) || (this.stage.equals(GameStage.POSTGAME)))) {
            p.getScoreboard().getObjective(DisplaySlot.SIDEBAR).getScore(ChatColor.STRIKETHROUGH + s.getName()).setScore(0);
          } else {
            p.getScoreboard().getObjective(DisplaySlot.SIDEBAR).getScore(s.getName()).setScore(((Integer)this.lives.get(i)).intValue());
          }
        }
      }
    This gives me multiple errors:
    (1) Syntax error on tokens, Expression expected
    instead
    (2) Syntax error on tokens, Name expected instead
    (3) Syntax error, insert ": Expression" to complete
    Expression
    (4) Syntax error on tokens, Expression expected instead
     
  2. Offline

    Boomer

    its the ???. as an object...

    Is this the result of a decompiler output?
     
  3. @Boomer
    Code:
    ???=this.player.iterator();continue;UUID i =(UUID)???.next();
    Yup, it is, I've seen that syntax before.
    @robin2310
    What plugin did you decompile? And are you a real developer?
     
  4. Offline

    Boomer

    There is enough code there that outlines what is being done within an interative loop.
    You just need to change the loop into a meaningful
    for (object o: collectionobject){} loop, or a meaningful iterator-object loop that makes sense for the framework of the objects being used in the loop
     
Thread Status:
Not open for further replies.

Share This Page