ItemStack Loop

Discussion in 'Spigot Plugin Development' started by MilkyBarStoner, Apr 6, 2014.

  1. Right!

    I have a List which has different ItemStacks in them
    Code (Text):
     public List<ItemStack> returnitems = new ArrayList<ItemStack>();
    At the end of my code I need all these Items given back to the Player! I did this like so
    Code (Text):
        for(ItemStack returns : returnitems) {
            player.getInventory().addItem(returns);
            player.sendMessage("items that could not be sold have been returned");
            returnitems.clear();
        }
    I am getting this Error though: http://paste.md-5.net/vabiyusuqu.avrasm

    Any Help is Greatly Appreciated <3
     
  2. Fixed!
    Issues was with
    Code (Text):
      returnitems.clear();
     
  3. Never mind, you solved it.
     
  4. That was the Correct Line :) I have fixed it don't worry. Thanks Thou :)