Replaces the jankson implementation with night-config. Night config is
what the forge api uses so it's easy to produce .toml files in the same
structure as CC:Tweaked.
All config options and comments from CC:Tweaked are implemented. Some
of these options are ignored in various bits of implementation but that
is another problem :)
Also splits the config into a client and server file. The server file is
saved per-world. Names and locations are consistent with CC:T.
I refactored the mixin package to be within a fabric package so other
fabric specific code could be kept nearby. But a mixin from a recent PR
got left behind in the merge. Github's empty merge conflict might have
been about this.
Made a top-level fabric package so mixins and their ancillary classes
can be grouped together. Also removed a stub duck interface that got
left behind somewhere along the line (MixedFirstPersonRenderer).
Forge's ITileEntity interface adds a onChunkUnloaded handler method into
block entities. The fabric port doesn't have a re-implementation of this
feature, which meant TileMonitors weren't releasing their buffers when
unloaded. This commit adds that handler method back into TileGeneric,
which all CC block entities inherit from. Handler logic for the four
block entities that use this feature were copied over from the forge
repo.
These buffers were being released on the server thread, causing the
logical server in a single player session to crash just before shutting
down. It seems the crash happened late enough to not cause world
corruption issues, and so went unnoticed. It was however causing a
memory leak when quitting/rejoining worlds, and it left the save file
lock in limbo.
Implementation is a little awkward, as we can't send OPEN_FILE links
from the server, so we ensure the client runs a
/computercraft open-computer ID command instead. We then intercept this
on the client side and use that to open the folder.
- Remove the service provider code and require people to explicitly
register these. This is definitely more ugly, but easier than people
pulling in AutoService or similar!
- Add an API for registering capabilities.
- Expand the doc comments a little. Not sure how useful they'll be, but
let's see!
There's still so much work to be done on this, but it's a "good enough"
first step.
This way we still get some differences between files and folders on
normal computers. I did try with just green, but I think the contrast is
too low.
Closes#656
Unlike short handles, we don't read these immediately, and so we can't
close it right away. Otherwise the file is considered empty!
FixesSquidDev-CC/treasure-programs#1