1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-07-02 10:03:32 +00:00
CC-Tweaked/projects
Jonathan Coates 93ad40efbb
Ensure the terminal exists when creating a monitor peripheral
Previously we had the invariant that if we had a server monitor, we also
had a terminal. When a monitor shrank into a place, we deleted the
monitor, and then recreated it when a peripheral was requested.

As of ab785a0906 this has changed
slightly, and we now just delete the terminal (keeping the ServerMonitor
around). However, we didn't adjust the peripheral code accordingly,
meaning we didn't recreate the /terminal/ when a peripheral was
requested.

The fix for this is very simple - most of the rest of this commit is
some additional code for ensuring monitor invariants hold, so we can
write tests with a little more confidence.

I'm not 100% sold on this approach. It's tricky having a double layer of
nullable state (ServerMonitor, and then the terminal). However, I think
this is reasonable - the ServerMonitor is a reference to the multiblock,
and the Terminal is part of the multiblock's state.

Even after all the refactors, monitor code is still nastier than I'd
like :/.

Fixes #1608
2023-10-09 22:09:01 +01:00
..
common Ensure the terminal exists when creating a monitor peripheral 2023-10-09 22:09:01 +01:00
common-api Add a tag for blocks wired modems should ignore 2023-09-11 21:29:17 +01:00
core Bump CC:T to 1.108.3 2023-10-08 15:25:45 +01:00
core-api Build a web-based emulator for the documentation site (#1597) 2023-10-03 09:19:19 +01:00
fabric Ensure the terminal exists when creating a monitor peripheral 2023-10-09 22:09:01 +01:00
fabric-api Publish Fabric jars to CF/Modrinth 2023-03-15 23:20:13 +00:00
forge Ensure the terminal exists when creating a monitor peripheral 2023-10-09 22:09:01 +01:00
forge-api License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00
lints Flesh out MemoryMount into a writable mount 2023-09-29 22:15:23 +01:00
web Pass follow_redirects flag to the CORS proxy 2023-10-08 20:12:47 +01:00
ARCHITECTURE.md License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00