This crate contains the generators for all of the autogenerated files in libcraft.
Code generators are written in python and live in python directory. The crate also contains rust code that generates the raw_block_states lookup table.
There are both shell and powershell scripts available to invoke the generators and generate all code.
Running these scripts requires rustfmt, cargo and python 3.6 or greater. Note that code generation is not a mandatory part of the build process, so you only need to regenerate code after modifying a generator script.
libcraft-generators currently provides the following generators:
- Generator for
Biomeenum inlibcraft-core - Generator for
BlockKindenum inlibcraft-blocks - Generator for
EntityKindenum inlibcraft-core - Generator for
Itemenum inlibcraft-items - Generator for
SimplifiedBlockKindenum inlibcraft-blocks - Generator for
Particleenum inlibcraft-core - Generator for the block state lookup table
Data is sourced from multiple sources.
PrimsarineJS/minecraft-data, which provides the majority of data. These files live in theminecraft-datasubdirectory, which is a Git submodule. Make sure that Git submodules are up to date before running the scripts.libcraft-datadirectory contains custom data files, made especially for libcraft.raw_block_statesgenerator uses block state data generated by the vanilla minecraftserver.jar- The block state data can be generated by downloading the
server.jarand runningjava -cp server.jar net.minecraft.data.Main --all
- The block state data can be generated by downloading the