Storing and accessing additional data with chunks is tricky. You have to store it externally, typically using ChunkEvent.Unload, ChunkDataEvent.Load and ChunkDataEvent.Save to manage the lifetime and persistence of some map. In my opinion, this is unnecessarily tricky.
The great advantage is that the chunk owns it capabilities; the capabilities attached to the chunk live as long as the chunk. This way it is nearly impossible to screw up attaching data to chunks.
My use case is a simple diagnostics mod that will attach a stack trace to chunks to determine how the chunk was loaded/generated. This is part of an ongoing effort to spread awareness about arbitrary chunk generation.
I remember asking about it on irc back when capabilities were relatively new, and the answer I got wasn't nice. But maybe I just didn't explain it well enough.
World cap that holds chunk coord -> data mappings?
Not really interested in discussing how to do it without chunk capabilities. It can be done. Properly storing it in the chunk has advantages which is why I am entertaining the idea.
Well we should list those advantages then to promote the idea
I'd like to say I support this idea, it would make certain features that need per-chunk information like pollution data (which is something currently being worked on in one of my mods) or other similar information much simpler and less risky to add
I think there are quite some use cases where that could be interesting. Like radiation (similar to what primetoxinz said).
A lot of region specific data could be saved in chunks rather than the world.
I think another interesting capability (duh) you get with chunk caps is the inherent sidedness of the system. Exposing data for a chunk based on the direction you're coming from might make sense for some systems (I bet radiation stuff could use it somehow) and you'd get it for free with caps.
Seeing as this has not been shot down yet I'll try making a PR.
Most helpful comment
Seeing as this has not been shot down yet I'll try making a PR.