GeezerVison is showing github.com — Implement new feather-generated crate. · feather-rs/feather@5b10a1f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .gitignore +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
12 | 12 | world/ |
13 | 13 | feather.toml |
14 | 14 |
|
| 15 | +**/__pycache__/ |
Collapse file
Copy file name to clipboard +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +[submodule "crates/generated/minecraft-data"] |
| 2 | + path = crates/generated/minecraft-data |
| 3 | + url = https://github.com/PrismarineJS/minecraft-data |
Collapse file
Copy file name to clipboardExpand all lines: Cargo.lock +246Lines changed: 246 additions & 0 deletions Collapse file
Copy file name to clipboard +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | [package] |
2 | 2 | name = "feather-generated" |
3 | 3 | version = "0.1.0" |
4 | | - |
5 | 4 | edition = "2018" |
6 | 5 |
|
7 | 6 | [dependencies] |
| 7 | +vek = "0.12" |
| 8 | +parking_lot = "0.11" |
Collapse file
Copy file name to clipboard +24Lines changed: 24 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +# feather-generated |
| 2 | + |
| 3 | +Code generated from JSON files. |
| 4 | + |
| 5 | +Code generators are written in Python and live in the `generators` directory. The script `regenerate.sh` |
| 6 | +can be used to invoke all generators and regenerate all code. |
| 7 | + |
| 8 | +Running these scripts requires `rustfmt` and Python 3.6 or greater. Note that code generation |
| 9 | +is not a mandatory part of the build process, so you only need to regenerate code after modifying |
| 10 | +a generator script. |
| 11 | + |
| 12 | +`feather-generated` currently provides the following: |
| 13 | +* Generated `Biome` enum and ID mappings. |
| 14 | +* Generated `BlockKind` enum, which is used by `feather-blocks`. |
| 15 | +* Generated `EntityKind` enum and ID mappings. |
| 16 | +* Slot conversion functions for inventories, including the `Window` struct. |
| 17 | +* Items and associated data (ID mappings, tool mappings, durability, ...) |
| 18 | +* The `Particle` struct with protocol ID mappings. |
| 19 | + |
| 20 | +Data is sourced from two sets of files: |
| 21 | +* [`PrimsarineJS/minecraft-data`](https://github.com/PrismarineJS/minecraft-data), which provides the majority |
| 22 | +of data. These files live in the `minecraft-data` subdirectory, which is a Git submodule. Make sure |
| 23 | +that Git submodules are up to date before running the scripts. |
| 24 | +* Feather's own data files, which live in the `feather` directory. |