1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-30 09:03:20 +00:00
CC-Tweaked/projects
Jonathan Coates 04900dc82f
Skip main-thread tasks if peripheral is detached
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.
2024-03-21 19:54:22 +00:00
..
common Skip main-thread tasks if peripheral is detached 2024-03-21 19:54:22 +00:00
common-api Move WiredNode default methods to the impl 2024-03-10 10:00:52 +00:00
core Skip main-thread tasks if peripheral is detached 2024-03-21 19:54:22 +00:00
core-api Fix a couple of warnings 2024-03-10 12:04:40 +00:00
fabric Custom equality for Fabric's storage types 2024-03-21 19:54:22 +00:00
fabric-api Rewrite turtle upgrade modeller registration API 2024-01-16 23:00:49 +00:00
forge Simplify the previous patch a little 2024-03-17 16:21:56 +00:00
forge-api Rewrite turtle upgrade modeller registration API 2024-01-16 23:00:49 +00:00
lints Send entire DFPWM encoder state to the client 2024-03-15 18:25:57 +00:00
standalone Allow local domains in the standalone emulator 2023-12-20 17:43:08 +00:00
web Bump checkstyle, fix warnings from TeaVM upgrade 2024-03-13 21:52:09 +00:00
ARCHITECTURE.md Add a standalone CC:T UI 2023-10-28 17:58:11 +01:00