ArrayList errors

Discussion in 'Plugin Help/Development/Requests' started by LeonTG77, Jun 6, 2015.

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

    LeonTG77

  2. Offline

    Funergy

    @LeonTG77
    java.util.ConcurrentModificationException

    That means the arraylist gets edited whilst a for loop is looping through the arraylist.
     
  3. Offline

    Goblom

    Your error is happening on Line 61 of ArenaCommand
     
  4. Offline

    LeonTG77

    @Goblom

    On that line:
    Code:
    b.getBlock().setType(a.blocks.get(b));
     
  5. Moved to Bukkit Alternates.
     
  6. Offline

    Goblom

    @bwfcwalshy Just a question, How does this classify as a "Bukkit Alternative"?
     
  7. @Goblom
    Code:
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot17.jar:git-Spigot-1649]
    He is using Spigot.
     
  8. Offline

    Goblom

  9. Offline

    LeonTG77

  10. Offline

    wxwsk8er

    There is your problem. Instead of creating a new HashMap<Location, {Other}> create a ConcurrentHashMap<Location, {Other}> this will allow you to edit and mess with it safely from your loop.

    And a little advise, don't look through a table while modifying your search way.
     
  11. Offline

    LeonTG77

    I fixed the error code, but IT STILL doesn't add water placement into the arraylist and not all the blocks are getting reset
     
  12. Offline

    LeonTG77

  13. Offline

    LeonTG77

  14. Offline

    LeonTG77

    Still not fixed...
     
Thread Status:
Not open for further replies.

Share This Page