Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize Crates #449

Merged
merged 18 commits into from
Aug 10, 2023
Merged

Reorganize Crates #449

merged 18 commits into from
Aug 10, 2023

Conversation

rj00a
Copy link
Member

@rj00a rj00a commented Aug 7, 2023

Objective

Once again I am trying to reorganize the crate structure into something I'm happy with. Hopefully I got it right this time.

The goal is to make it easier to extend valence without an explosion of tiny crates or other problems. Also fixing miscellaneous issues along the way.

Solution

  • Replaced valence_client with valence_server to accommodate a wider variety of modules. valence_server is glob re-exported from the main valence crate.
  • All of the modules that were previously in valence_client have become individual plugins for more flexibility.
  • Merged valence_server and valence_layer since they were already tightly coupled. Removed lots of #[doc(hidden)] as a result.
  • Brought back valence_protocol to contain all protocol related stuff. Replaces valence_packet and valence_core. This can be used by servers, clients, proxies, and other tools without dragging in valence-specific things.
  • Consolidated most generated code into valence_generated. Keeping this in one crate resolves some potential circular dependency issues between things like items and blocks. valence_protocol depends on this so we can use BlockState and other types in packets. It might slow down the build too much, so we could split it up if we have to.
  • Created valence_math. This re-exports glam + our own Aabb type which was previously in valence_core.
  • Merged valence_biome and valence_dimension into valence_registry.
  • Split off JSON text and resource identifiers into valence_text and valence_ident respectively.
  • Created valence_lang to hold language related code like translation keys. There's not much there now, but it could be used for a registry of languages and translation keys in the future.
  • Added type alias for the compression threshold type.
  • Cleaned up many imports.

depgraph

TODO

  • Add missing docs, READMEs, etc.

@rj00a rj00a enabled auto-merge (squash) August 9, 2023 15:44
@rj00a rj00a merged commit ca25a46 into main Aug 10, 2023
13 checks passed
@rj00a rj00a deleted the reorganize branch August 10, 2023 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant