Skip to content

Upgrade to 1.16 + big refactor + initial plugin API#307

Merged
caelunshun merged 85 commits intodevelopfrom
1.16
Feb 27, 2021
Merged

Upgrade to 1.16 + big refactor + initial plugin API#307
caelunshun merged 85 commits intodevelopfrom
1.16

Conversation

@caelunshun
Copy link
Member

@caelunshun caelunshun commented Aug 23, 2020

Upgrades the codebase to support 1.16.2 1.16.3 1.16.5 as the sole supported version.

Also, this PR includes a substantial refactor in terms of the crate structure. I'll elaborate more on this as the refactor progresses.

(Not even close to finished!)

Key changes (planned, not all implemented yet):

  • Implement feather-protocol as the successor to feather-network.
  • Use new feather-generated crate for protocol IDs and data (this crate replaces feather-data and feather-definitions)
  • Systems now return an anyhow::Result which can be an Err variant when an internal error occurs (e.g. an entity is missing a component, or a resource is not present.) Systems should no longer use unwrap or panic in most cases.
  • Move all gameplay-related systems into new feather-common crate.
  • feather-server now only contains systems needed to send and receive packets. All gameplay functionality is implemented in feather-common.
  • Add a new, experimental dynamic linking workflow that could help iteration times during development.

Resolves #220.
Resolves #270.

This is going to be a major change in how the crate structure is organized.
I'll explain more about this in future commits, once the refactor begins to take shape.
This crate generates a bunch of code from a variety of sources. It's intended to replace
`feather-definitions` and `feather-data`, to some extent.
I switched from Legion to hecs because:
* Legion's API is generally verbose and difficult to use in cases it wasn't
built for.
* Legion brings on unnecessary functionality, such as its systems scheduler, which is
bad impact on compile times.
* Legion doesn't support proper change detection. (Hecs doesn't either,
but right now I'm using Bevy's fork of it, which has change detection
in first-class.)
This ports the block code generator to 1.16 and the new crate layout.
I've changed it to ingest data from the Vanilla data report outputted
according to https://wiki.vg/Data_Generators.

Instead of taking data from feather-data, the generator now expects the
blocks report to have been manually generated in the current directory.
The benefit of this is that feather-data can be removed from the build process. I know many had
problems with the JDK and rustfmt requirements, so this simplifies things nicely.

Block code is no longer automatically generated at build time; now creating it
must be done manually. That said, it's cached in Git, so regenerating code
is only necessary when we upgrade to a new version.

This commit only ports the generator. What still needs to be done:
* Block categories, wall_blocks, directions
* SimplifiedBlockKind
This ports SimplifiedBlockKind to `feather-generated`, the successor to `feather-definition`s.
This implements the initial plugin API.

The code is rough in some areas, especially the query code. There is some unsafe magic
that needs reviewing and cleaning up. But so far, the code seems to work.
@caelunshun caelunshun changed the title Upgrade to 1.16 + big refactor Upgrade to 1.16 + big refactor + initial plugin API Feb 9, 2021
@caelunshun
Copy link
Member Author

I've just pushed an initial implementation of the barebones plugin API.

As this is becoming a colossal PR, I'm going to merge it in a few days, if nobody has objections. I think it's time we moved development back to the main branch :)

@caelunshun caelunshun mentioned this pull request Feb 9, 2021
20 tasks
@caelunshun caelunshun marked this pull request as ready for review February 26, 2021 23:36
@caelunshun
Copy link
Member Author

Finally time to merge this!

Some features were lost in the rewrite, so I've moved the old code from before this PR into the old directory. Old functionality can be reimplemented with the aid of that old code.

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.

Implement smoother chunk streaming Update MC implementation from 1.13.2 to 1.16.2

2 participants