azalea/codegen
mat d112856ff6
Entity metadata (#37)
* add example generated metadata.rs

* metadata.rs codegen

* add the files

* add comment to top of metadata.rs

* avoid clone

* metadata

* defaults

* defaults

* fix metadata readers and writers

* fix bad bitmasks and ignore some clippy warnings in generated code

* add set_index function to entity metadatas

* applying metadata
2022-11-06 14:05:01 -06:00
..
lib Entity metadata (#37) 2022-11-06 14:05:01 -06:00
.gitignore rename code-generator to codegen 2022-05-24 20:28:08 -05:00
genblocks.py All block shapes & collisions (#22) 2022-10-02 12:29:47 -05:00
genentities.py Entity metadata (#37) 2022-11-06 14:05:01 -06:00
genregistries.py Azalea registry (#20) 2022-08-27 20:31:21 -05:00
migrate.py Azalea registry (#20) 2022-08-27 20:31:21 -05:00
newpacket.py genblocks 2022-05-28 18:20:15 -05:00
README.md All block shapes & collisions (#22) 2022-10-02 12:29:47 -05:00

Tools for automatically generating code to help with updating Minecraft versions.

The directory name doesn't start with azalea- because it's not a Rust crate.

Requirements

  • Python 3.8+
  • Java 17+
  • Gradle

Usage

Generate packet:
python newpacket.py [packet id] [clientbound or serverbound] \[game/handshake/login/status\]
This will create a new file in the azalea-protocol/src/packets/\[state\] directory. You will probably have to manually fix up the auto generated code.

Migrate to a new Minecraft version:
python migrate.py [new version]
This updates all the packet ids in azalea-protocol/src/packets/mod.rs and creates all the new packets.