mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-05 17:46:21 +00:00
04900dc82f
Due to the asynchronous nature of main-thread tasks, it's possible for them to be executed on peripherals which have been detached. This has been known for a long time (#893 was opened back in 2021), but finding a good solution here is tricky. Most of the time the method will silently succeed, but if we try to interact with an IComputerAccess (such as in inventory methods, as seen in #1750), we throw a NotAttachedException exception and spam the logs! This is an initial step towards fixing this - when calling a peripheral method via peripheral.call/modem.callRemote, we now wrap any enqueued main-thread tasks and silently skip them if the peripheral has been detached since. This means that peripheral methods may start to return nil when they didn't before. I think this is *fine* (though not ideal for sure!) - we return nil if the peripheral has been detached, so it's largely equivalent to that. |
||
---|---|---|
.. | ||
src | ||
build.gradle.kts |