CraftStudio API

CraftStudio API

12M Downloads

ConcurrentModificationException

mcpecommander opened this issue ยท 6 comments

commented
commented

Sorry, for the late answer.
But what are you talking about ? The link goes to the line
public boolean canUpdateAnimation(Channel channel, T animatedElement) {
There's no iteration here, or in the function. Could you please give more information.
Furthermore, it will be really helpful to have a crach report and context description, if you encountered the bug yourself.

commented
commented

and here is the crash report that one of my mod users had :
https://pastebin.com/8CV9RLeL
I am currently not working on my mod due to school and I am not returning before may so I might be of less help than expected

commented

It's not this line that cause the problem, but a much deeper problem that I never had the bravery to hunt and fix. You can delete something from a list while you are iterating it with an iterator, that's the purpose of the iterator in fact. The problem is that the list/map is accessed by multiple thread at the same time, so sometimes (rarely) a thread is iterating over the map while this line is modifying it. And so this Exception is reased, I will try to fix this for the next update.

commented

The problem that I encountered this bug a lot before and it is related to how animations are run together so technically I can make sure that each animation is running on its own to make sure this never happens but that is not possible since walking animation and looking animations are always run at the same time.

commented

After a lot of checking this bug exists mainly when running two animation at the same time but only when one is a custom channel and the second is a usual json.