Java errors when calling listItems() on an RS system
ramonGonzEdu opened this issue ยท 2 comments
Descripe
When calling listItems() on a RS system that is imported/exported from constantly, java errors can happen. I believe this is because the lua code runs on a separate thread, so any importers/exporters running on the main thread can mess up the lua thread.
The two errors are:
java.util.NoSuchElementException
: I assume this happens because the main mc thread removes an item from the item list while the lua list is iterating over it. Adding a lock mechanism should fix this. Stack trace from minecraft log: https://pastebin.com/tYZxVWKyjava.util.ConcurrentModificationException
: This seems like the same issue, except that it happens much less since it happens when the RS system is trying to change an item value while the peripheral is trying to read it. Stack trace from minecraft log: https://pastebin.com/AsZxLZuZ
Steps to reproduce
- Create a RS system with various importers and exporters which add/remove items and entire item objects (i.e goes from 1 -> 0)
- repeatedly call
getItems
on an RS peripheral connected to the RS system
Version
0.7r
Minecraft, Forge and maybe other related mods versions
Forge 36.2.2 Minecraft 1.16.5
Screenshots or Videos
Crashlog/log
https://pastebin.com/tYZxVWKy and https://pastebin.com/AsZxLZuZ