Commit Graph

799 Commits

Author SHA1 Message Date
Florian Nücke
3e6d62ec81 Upload textures for projectors immediately to avoid GL error before first frame arrives. 2022-02-07 22:55:20 +01:00
Florian Nücke
3056d55d10 Fix GL errors due to disposed textures still being bound after rendering multiple projectors at once. 2022-02-07 22:55:00 +01:00
Florian Nücke
9a8b278aa0 Send detailed projector state to client, show red lens when not powered. 2022-02-07 22:26:25 +01:00
Florian Nücke
96a3366031 Show projector energy consumption in tooltip.
Also show base energy consumption of computers in tooltip.
2022-02-07 20:36:09 +01:00
Florian Nücke
e1b6fc2618 Add JEI plugin to tell it about the sidebars in our computer/robot UIs. 2022-02-07 17:44:47 +01:00
Florian Nücke
2794002324 Moved lock leading to waits on main thread for encoding worker thread. 2022-02-07 13:34:06 +01:00
Florian Nücke
917a37999e Only copy depth when will render projector. Flush other render layers that may write to depth when we do. 2022-02-07 12:06:07 +01:00
Florian Nücke
34d82e39d3 Make projector not break when some other mod enables stencil for the main render target. 2022-02-07 09:57:20 +01:00
Florian Nücke
95eb8997cb Got rid of a mixin. 2022-02-06 23:41:31 +01:00
Florian Nücke
bf4425902d Don't inject names when there's no other devices. 2022-02-06 21:38:25 +01:00
Florian Nücke
d8dc608e89 Fix potential (silent) NRE when no data is available after all. 2022-02-06 21:38:10 +01:00
Florian Nücke
7a4037eb61 Remove listener tracker when last listener is removed. 2022-02-06 21:37:43 +01:00
Florian Nücke
961f04a54c Fixed ghost loading bug in projector. 2022-02-06 21:37:19 +01:00
Florian Nücke
e1f51118cd Fixed chunk load/unload listeners only firing once. 2022-02-06 20:48:08 +01:00
Florian Nücke
fb8b9d4c9f Fix projector watcher caching.
On write didn't do what I hoped it'd do in combination with computed get.
2022-02-06 20:33:57 +01:00
Florian Nücke
6d726de6ae Fix updating boot error to clients.
Just always send it. Happens rarely and is a tiny packet. Could lead to incorrect client state, because sent value is computed and not the base error message (can be dynamically overridden by bus state).
2022-02-06 19:02:26 +01:00
Florian Nücke
b9f64e5de4 Fix computers adding their own devices without attached interface. 2022-02-06 19:01:13 +01:00
Florian Nücke
01c28eb6ad Default new projectors to not be lit. 2022-02-06 19:00:53 +01:00
Florian Nücke
c926c3cd37 Only mark chunks as unsaved for tracked bus elements, not their neighbors.
Since data for managed devices is saved in the bus interfaces, this is enough. If blocks hold extra data for devices, it is their responsibility to set their chunk's dirty flag as necessary.
2022-02-06 14:35:45 +01:00
Florian Nücke
94f41f925a Have bus interfaces track their neighbor chunks, if necessary.
Needed to properly react to block devices in neighbor chunk being unloaded/loaded. Since we detect devices independent of bus scan, to ensure we can detect removed devices without a bus scan, we need to track this here, too. We cannot rely on the bus controller telling us to re-scan devices once the bus is complete.
2022-02-06 14:00:52 +01:00
Florian Nücke
a40899d748 Block device queries have optional result now, empty indicating unloaded area.
Use this to properly handle missing neighbor in bus interfaces -- don't treat them as removed, just unload them, instead.
2022-02-06 13:59:24 +01:00
Florian Nücke
4f3ffe7a82 Small rename. 2022-02-06 13:34:01 +01:00
Florian Nücke
47904385c2 Fixed removing cable part not directly triggering bus scan.
Not *strictly* necessary, since for multiple connected cables, neighbors will trigger a scan, and for single cable on computer, computer will trigger a scan. But this is more robust in case these assumptions change in the future.
2022-02-06 13:33:14 +01:00
Florian Nücke
7698ee5bde Small legacy naming fix. 2022-02-06 13:30:29 +01:00
Florian Nücke
0736cdc9a0 Remove unneeded call.
Keep it out after all...
2022-02-06 01:46:35 +01:00
Florian Nücke
6fbc455c2f Add util record for describing chunk pos in a level.
Adjust block pos one to match (also use a weak level ref).
2022-02-06 01:45:38 +01:00
Florian Nücke
6ad13b9c02 Ignore removal if block entity was already unloaded.
Fixes computers losing their memory and such...
2022-02-05 17:49:10 +01:00
Florian Nücke
ce0c99b6e4 Guess we have to do it like this.
Since VM can trigger state change in VMDevices that's not observable, just flag everything dirty that's touched by the VM. Sure, theoretically VMDevices could be adjusted to have events when they change, but that would then also need to get synced back to main thread, yada yada. This seems... reasonable enough.
2022-02-05 15:46:23 +01:00
Florian Nücke
ad8082e056 Actually, that won't solve anything, so keep it out of the API for now. 2022-02-05 15:35:54 +01:00
Florian Nücke
814f9d37dd Split up vm and rpc device packages. 2022-02-05 15:09:33 +01:00
Florian Nücke
6f7f0fa048 Similar to how it is for blocks now, allow providing devices as capabilities from items. 2022-02-05 14:40:16 +01:00
Florian Nücke
5ecafeba16 Make some devices properly tell their container they changed.
Item devices for computer/robot, so not strictly necessary, but for clarity.
2022-02-05 14:16:10 +01:00
Florian Nücke
2b3858bd14 Make computer not detecting devices explicit. 2022-02-05 14:06:45 +01:00
Florian Nücke
581994327d Make item bus element update logic read a bit more similar to block one. 2022-02-05 13:58:10 +01:00
Florian Nücke
73d43ee254 Add API to give devices a reference to their context, to flag stuff as dirty e.g. 2022-02-05 13:21:19 +01:00
Florian Nücke
3719e01447 Cleaned up bus element implementations a little, to straighten the logical flow. 2022-02-05 13:14:48 +01:00
Florian Nücke
364f5ff83f Util method for no-op runnable. 2022-02-05 13:09:16 +01:00
Florian Nücke
83023715a1 Use nice names for samplers. 2022-02-05 11:16:26 +01:00
Florian Nücke
3351b036d6 Return device as capability for disk drive and projector. 2022-02-04 21:15:21 +01:00
Florian Nücke
0d62751110 Always use relative pos to main camera to reduce precision errors. 2022-02-04 19:35:04 +01:00
Florian Nücke
68d6dc85f6 Fix numeric key evdev mapping. 2022-02-04 16:42:08 +01:00
Florian Nücke
2b9b2399f5 Add overlay for keyboard screen, hide hotbar. Improve input handling. 2022-02-04 16:41:31 +01:00
Florian Nücke
5e605c3400 First draft for the keyboard block. 2022-02-04 13:19:36 +01:00
Florian Nücke
c0268cb6e1 Check bus block entity validity while screen is open. 2022-02-04 10:23:58 +01:00
Florian Nücke
1c7da6835b Sorted some things. 2022-02-04 10:23:09 +01:00
Florian Nücke
781670b47c Fix keyboard deserialization. 2022-02-04 09:30:41 +01:00
Florian Nücke
04ee0bc582 Fix not sending frame to client when they start observing a projector that's not changing. 2022-02-03 21:58:26 +01:00
Florian Nücke
c1679223bd Add SPDX header. 2022-02-03 21:42:17 +01:00
Florian Nücke
5e9dd1a4e5 Organize imports. 2022-02-03 21:33:04 +01:00
Florian Nücke
e28370ae1c Make projector emit some light while projecting something. 2022-02-03 21:24:20 +01:00