Chernobyl 0 Share Posted August 12, 2017 Hello, I need your help guys. I want to get all trees in a specific area.... List<GameObject> trees = getGameObjects().all(t -> woodArea.contains(t) && t != null && t.getName().equals("Tree")); Without the area condition it works, if not I get ConcurrentModdificationException Can you explain me what I did wrong please? [ERROR]17:32:51: Exception has occurred while running! Please report error to developer if problem persists: java.util.ConcurrentModificationException at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.dreambot.api.methods.interactive.GameObjects.all(GameObjects.java:72) at org.dreambot.api.methods.interactive.Interactables.all(Interactables.java:59) at TreeChopper.getTarget(TreeChopper.java:100) at TreeChopper.onLoop(TreeChopper.java:555) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:251) at java.lang.Thread.run(Thread.java:748) Tank you. Link to comment Share on other sites More sharing options...
Manly 879 Share Posted August 12, 2017 Put the null check first in your filter and try again. Link to comment Share on other sites More sharing options...
Chernobyl 0 Author Share Posted August 12, 2017 Put the null check first in your filter and try again. I get the same error again. Link to comment Share on other sites More sharing options...
Manly 879 Share Posted August 12, 2017 I get the same error again. Is woodarea modified by another thread? Link to comment Share on other sites More sharing options...
Chernobyl 0 Author Share Posted August 13, 2017 Fixed. The area was not generated! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.