ConcurrentModificationException
mcpecommander opened this issue ยท 6 comments
https://github.com/Leviathan-Studio/CraftStudioAPI/blob/7d3689cf4097bce1c1571372e82d848bf0ce0821/src/main/java/com/leviathanstudio/craftstudio/client/animation/ClientAnimationHandler.java#L175
this line is causing a ConcurrentModificationException since you can not just remove an object while iterating it.
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.
sorry it became this line instead
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
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.
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.