Elenai Dodge 2 can sometimes cause JEI / HEI tooltip reload from Set Bonus to fail
Laike-Endaril opened this issue ยท 0 comments
Because of this code in Elenai Dodge 2:
https://github.com/ElenaiDev/ElenaiDodge2.0/blob/c9f0acf6f7dd688240ed88a6a6d999a962e85a86/src/main/java/com/elenai/elenaidodge2/event/TooltipEventListener.java#L39
If 2 (or more) client threads access item tooltips at the same time, it can cause a concurrent modification exception.
Tbh, the easiest way to handle this specific case would be to fork Elenai Dodge 2 and fix it, and release my own version...but if another mod had a similar issue, this would come back up.
On the flipside, I could probably catch the exception on the Set Bonus side, and re-read the tooltip for the errored item (a limited number of times), but the downside here is that it might be possible for any other mods with similar issues to end up with undefined results on the main thread, depending on what they do with the tooltips.
So I'm still thinking on this one...
...probably most robust overall solution is to prevent the client thread and the reloader thread from Set Bonus from accessing the tooltip getters at the same time, period
...and the 2nd most robust solution is probably to force a crash from the Set Bonus side when this happens, for maximum issue visibility, and then fix the mod(s) with the threading issues.