Change valence-anvil to be more general
Earthcomputer opened this issue · 3 comments
Describe the problem related to your feature request.
Currently, there are two problems with valence-anvil
:
- It is specific to block state chunks, whereas nowadays Mojang uses the anvil format for entities and POIs too, and possibly other things in the future.
- It is specific to Bevy and
valence-server
, including a Bevy plugin and requiring a biome registry respectively, which makes it harder to justify the use of this crate as a library outside of Valence, like you can withvalence_nbt
.
What solution would you like?
There needs to be a lower-level public API to simply get a Compound
given some chunk coordinates, and to be able to store a new Compound
to some new or existing chunk coordinates. The blockstate, entity and POI stuff can then be built on top of that, possibly in a separate crate or in the same crate with feature flags. The Bevy plugin could also be either a separate crate or in the same crate with a feature flag.
What alternative(s) have you considered?
The valence-anvil
crate could be left as it is, and I could make an alternative crate which is not specific to Valence. However, I think that not only could 3rd parties benefit to this restructuring, but Valence itself could too. It would help work towards some of the goals in the 0.2 roadmap, such as serialization support for anvil worlds, and would also be helpful for loading and saving entities if that is something you want.
Additional context
I am working on a program to upgrade worlds (like the optimize worlds button in Minecraft), and need an anvil parser to upgrade chunks.
Just FYI I'm happy to do any implementation work related to this, I just want to make sure I am helping to take Valence in the right direction according to how you guys want it.
I'm in favor of this. It would be nice if we could decouple the bevy stuff from the anvil stuff as much as possible.
Sounds good 👍🏻 Putting the Valence/Bevy stuff behind feature flags seems like the right approach to me.