You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently chunks are intended to be independent of the world however I think we should change this behaviour.
There is an issue when adding chunks to a world that the same chunk object may already be in a different world.
Should editing this chunk object change the chunk in both worlds?
Should marking the chunk as changed do so for both worlds?
Which block and biome palette should the chunk reference?
I think it would make it a lot easier if each chunk was associated with at most one level.
Putting the chunk in a different level would copy the chunk and put the copy in the new level leaving the original in the old one.
After some thought I think we should make the level manage if the chunk has changed and switch to a get set system that deep copies the chunks.
It makes threading simpler because only one thread can modify a chunk at the same time
There are benefits to be able to go from the chunk to the level that owns it.
I would need to think through what effects this would have on deep copying and serialising the data.
Feature Request
The Problem
Currently chunks are intended to be independent of the world however I think we should change this behaviour.
There is an issue when adding chunks to a world that the same chunk object may already be in a different world.
Should editing this chunk object change the chunk in both worlds?
Should marking the chunk as changed do so for both worlds?
Which block and biome palette should the chunk reference?
I think it would make it a lot easier if each chunk was associated with at most one level.
Putting the chunk in a different level would copy the chunk and put the copy in the new level leaving the original in the old one.
This would also make it possible to reach back into the world that owns the chunk. Amulet-Team/Amulet-Map-Editor#685
Feature Description
Add a weak reference to the chunk that stores the level that owns the chunk.
This may be None if the chunk is an orphan chunk.
Here is a prototype including this
https://gist.github.com/gentlegiantJGC/d0f0b6d34db696b5e5d41d166a0033e0
The text was updated successfully, but these errors were encountered: