Thread ERROR

Discussion in 'Plugin Development' started by LordManegane, Feb 24, 2014.

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

    LordManegane

    Well im using a method that in the past versions, works fine for me but wen i do it in 1.7.2 and higher, it crashs saying: Encountred an unexpected exception java.util.ConcurrentModificationException
     
  2. Offline

    Alshain01

    Help us help you.
     
  3. Offline

    LordManegane

  4. Offline

    Alshain01

    That makes two of us. You have to give us something to troubleshoot. You've told use you used to use "a method" but I have no idea which of the thousands of methods in Bukkit, or for that matter, Java that your referring to. There is no code to troubleshoot. Nobody here is a mind reader, you gotta give us something.
     
  5. Offline

    L33m4n123

  6. Offline

    LordManegane

    Alshain01

    Code:java
    1. public class Test extends Thread{
    2.  
    3. Plugin plugin;
    4. List<Block> list;;
    5. public Test(String s, Main instance, List<Block> list){
    6. super(s);
    7. plugin = instance;
    8. this.list = list;
    9. }
    10.  
    11. public void run(){
    12.  
    13.  
    14.  
    15. for(int i = 0; i <= (list.size -1);i++){
    16. Block block = list.get(i);
    17. block.setTypeId(1);
    18.  
    19. }
    20.  
    21.  
    22.  
    23.  
    24.  
    25.  
    26. try {
    27. TimeUnit.MILLISECONDS.sleep(4);
    28. } catch (InterruptedException e) {
    29. // TODO Auto-generated catch block
    30. e.printStackTrace();
    31. }
    32.  
    33.  
    34. }
    35.  
    36. this.stop();
    37.  
    38.  
    39.  
    40.  
    41.  
    42.  
    43. }
    44. }


    Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  7. Offline

    Alshain01

  8. Offline

    LordManegane

    Alshain01 I tried that, but when im doing heavy amounts of changes, the game kick out the current players
     
  9. Offline

    Alshain01

    You really just can't do that. Trust me if there were a way to change large parts of the world asynchronously, WorldEdit would be doing it.
     
  10. Offline

    LordManegane

    Alshain01 With this method i cant do sleeps so it kick players out =P
     
  11. Offline

    Jake6177

    Same thing happens with WorldEdit if you edit too large an area at a time.
     
  12. Offline

    Alshain01

    Pretty much what Jake6177 said. If the biggest most complex world editor out there doesn't do it, there is a good reason why.
     
Thread Status:
Not open for further replies.

Share This Page