2794002324
Moved lock leading to waits on main thread for encoding worker thread.
Florian Nücke
2022-02-07 13:11:47 +01:00
917a37999e
Only copy depth when will render projector. Flush other render layers that may write to depth when we do.
Florian Nücke
2022-02-07 12:06:07 +01:00
34d82e39d3
Make projector not break when some other mod enables stencil for the main render target.
Florian Nücke
2022-02-07 09:57:20 +01:00
95eb8997cb
Got rid of a mixin.
Florian Nücke
2022-02-06 23:41:31 +01:00
b9f64e5de4
Fix computers adding their own devices without attached interface.
Florian Nücke
2022-02-06 19:01:13 +01:00
01c28eb6ad
Default new projectors to not be lit.
Florian Nücke
2022-02-06 19:00:53 +01:00
c926c3cd37
Only mark chunks as unsaved for tracked bus elements, not their neighbors.
Florian Nücke
2022-02-06 14:35:45 +01:00
94f41f925a
Have bus interfaces track their neighbor chunks, if necessary.
Florian Nücke
2022-02-06 14:00:52 +01:00
a40899d748
Block device queries have optional result now, empty indicating unloaded area.
Florian Nücke
2022-02-06 13:59:24 +01:00
4f3ffe7a82
Small rename.
Florian Nücke
2022-02-06 13:34:01 +01:00
47904385c2
Fixed removing cable part not directly triggering bus scan.
Florian Nücke
2022-02-06 13:33:14 +01:00
7698ee5bde
Small legacy naming fix.
Florian Nücke
2022-02-06 13:30:29 +01:00
0736cdc9a0
Remove unneeded call. Keep it out after all...
Florian Nücke
2022-02-06 01:46:35 +01:00
6fbc455c2f
Add util record for describing chunk pos in a level. Adjust block pos one to match (also use a weak level ref).
Florian Nücke
2022-02-06 01:45:38 +01:00
6ad13b9c02
Ignore removal if block entity was already unloaded. Fixes computers losing their memory and such...
Florian Nücke
2022-02-05 17:49:10 +01:00
ce0c99b6e4
Guess we have to do it like this.
Florian Nücke
2022-02-05 15:46:23 +01:00
ad8082e056
Actually, that won't solve anything, so keep it out of the API for now.
Florian Nücke
2022-02-05 15:35:48 +01:00
814f9d37dd
Split up vm and rpc device packages.
Florian Nücke
2022-02-05 15:09:33 +01:00
6f7f0fa048
Similar to how it is for blocks now, allow providing devices as capabilities from items.
Florian Nücke
2022-02-05 14:40:16 +01:00
5ecafeba16
Make some devices properly tell their container they changed. Item devices for computer/robot, so not strictly necessary, but for clarity.
Florian Nücke
2022-02-05 14:16:10 +01:00
2b3858bd14
Make computer not detecting devices explicit.
Florian Nücke
2022-02-05 14:06:45 +01:00
581994327d
Make item bus element update logic read a bit more similar to block one.
Florian Nücke
2022-02-05 13:58:10 +01:00
73d43ee254
Add API to give devices a reference to their context, to flag stuff as dirty e.g.
Florian Nücke
2022-02-05 13:21:19 +01:00
3719e01447
Cleaned up bus element implementations a little, to straighten the logical flow.
Florian Nücke
2022-02-05 13:14:48 +01:00
5e9dd1a4e5
Organize imports.
Florian Nücke
2022-02-03 21:33:04 +01:00
e28370ae1c
Make projector emit some light while projecting something.
Florian Nücke
2022-02-03 21:24:20 +01:00
2b368cab05
Don't render projection if there's no way player can see it (too far in front of projector).
Florian Nücke
2022-02-03 20:22:03 +01:00
85363b8835
Add recipe for projector block. Adjusted a few other recipes.
Florian Nücke
2022-02-03 19:55:56 +01:00
29b1d4eb08
Fix data generator breaking because apparently that's CLIENT side.
Florian Nücke
2022-02-03 19:37:24 +01:00
9af06ea459
Ensure client-side event listeners are only added on client.
Florian Nücke
2022-02-03 19:27:33 +01:00
8ba0a93144
Small rewording.
Florian Nücke
2022-02-03 19:14:48 +01:00
fe2fdc9391
Make sides and front of projector non "solid" to avoid torch placement and such.
Florian Nücke
2022-02-03 19:11:44 +01:00
0f2c34f287
Don't do stuff with the VM in computers on client side.
Florian Nücke
2022-02-03 17:32:55 +01:00
4c4385f0ec
Don't do stuff with the VM in robots on client side.
Florian Nücke
2022-02-03 17:31:33 +01:00
94318dceee
Run all sending of framebuffer data through a load balancer, so we have more control over bandwidth use. Penalize projectors that a) send to multiple clients, b) are far away from players.
Florian Nücke
2022-02-03 17:31:14 +01:00
ced5a0b5b4
Catch buffer overflow exceptions in encode, since apparently these can happen. Only seen this when flooding with random, which is... esoteric. So silently swallow this to avoid users deliberately spamming server logs.
Florian Nücke
2022-02-02 02:08:01 +01:00
ee232dc049
Disable projection when occluded.
Florian Nücke
2022-02-02 01:33:16 +01:00
05c2f43abd
Use frustum matrix for projector depth rendering, to allow flat projection onto surfaces while still offsetting upwards. Ensure render bounds for projectors always work. Render weather into projector depth so that rain casts shadows.
Florian Nücke
2022-02-02 01:06:09 +01:00
6c6bcadee5
Tighter fit on projection.
Florian Nücke
2022-02-02 00:56:58 +01:00
2361a84b8e
Use actual projection rendering for projectors.
Florian Nücke
2022-02-01 20:18:55 +01:00
59a3a2b127
Trying to render level for projector depth.
Florian Nücke
2022-01-30 14:31:08 +01:00
3e2914ba9e
Use annotations to register event listeners.
Florian Nücke
2022-01-28 19:08:25 +01:00
539beb4e0f
Being reasonable is boring.
Florian Nücke
2022-01-25 18:20:13 +01:00
cbb19eff70
Small rename.
Florian Nücke
2022-01-28 00:58:59 +01:00
b75f5cbca2
Simplify network device run state switching. Can't remember why all the events were needed before. Joining worker thread should be enough, since when unmounting one, we unmount all. So there should be no way to read/write from network device after vm devices were unmounted (and memory closed).
Florian Nücke
2022-01-28 00:56:32 +01:00
ae13fca2e9
Rework VMDevice to be more intuitive for typical cases. unmount() is now called in addition to when suspend() was called before. dispose() is called after unmount() if cleanup is required (machine stopped, device removed).
Florian Nücke
2022-01-28 00:55:16 +01:00
82a6702b33
Rework RPCDevice to be more intuitive for typical cases. unmount() is now called in addition to when suspend() was called before. dispose() is called after unmount() if cleanup is required (machine stopped, device removed).
Florian Nücke
2022-01-27 20:10:41 +01:00
bd1b46882e
Mark chunk lazy dirty when charger charged something, so its stored energy changed.
Florian Nücke
2022-01-27 11:16:39 +01:00
a5cf919f23
Mark chunk dirty when bus interface name changes.
Florian Nücke
2022-01-27 11:15:58 +01:00
28304b1a28
Make some more block entities use custom base class for consistency.
Florian Nücke
2022-01-27 11:15:38 +01:00
1ab2b8ea24
Run firmware check first, as quasi-early exit, before checking vm devices.
Florian Nücke
2022-01-27 11:15:14 +01:00
d9c86cbca5
Add system to mark chunks as "lazy unsaved". Avoids serialization of chunks with computers in them every single tick. Since computers state changes every tick they're running, flagging the chunk unsaved every chunk would be necessary. However, this is undesirable, because it triggers an NBT serialization ever tick. Which is slow. To avoid this, we now track a "lazy unsaved" flag for chunks, which computers can set. This flag is applied to the real unsaved flag during explicit saves, right before the unsaved flag is checked. Explicit saves include chunk unloads, pausing in single-player, server stopping and the save command, for example.
Florian Nücke
2022-01-27 11:13:22 +01:00
9410781c25
[BREAKING] Reworked RPC method API to be more flexible. RPCDevices now return a list of RPCMethodGroups instead of RPCMethods directly. RPCMethodGroups can be queried for a method based on an invocation. They can also optionally provide a list of all overloads, for documentation purposes (queried by VM). Overloads are the old RPCMethods, now taking the same invocation information the lookup method takes. For convenience, RPCMethods are also singleton RPCMethodGroups.
Florian Nücke
2022-01-26 03:13:30 +01:00
557a1b1dc1
Make types optional in documentation generators.
Florian Nücke
2022-01-26 02:40:47 +01:00
0126c6e5f6
Fix use of deprecated method.
Florian Nücke
2022-01-26 00:22:08 +01:00
ba3bc7776c
Add never called overrides with exception for clarity.
Florian Nücke
2022-01-26 00:16:07 +01:00
ded98fc652
Fixed synthetic devices being collected from sides that should not collect devices. No real effect (ignored in method gathering because empty), but still unnecessary clutter.
Florian Nücke
2022-01-26 00:14:46 +01:00
5f892f2341
Fixed no bus scan being triggered when bus cable is placed after bus interface.
Florian Nücke
2022-01-26 00:13:59 +01:00
79ab0f08e0
Fix missing space in documentation.
Florian Nücke
2022-01-26 00:12:37 +01:00
929f13d240
fixup! Add option to clean up stuff (via unmount) when devices go missing. For block devices, this can happen when the block is broken while the computer is unloaded, for example. For items this is more esoteric, but it theoretically means items disappear while the container managing the item as a device is unloaded.
Florian Nücke
2022-01-25 20:29:17 +01:00