Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

libcraft-generators

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 Biome enum in libcraft-core
  • Generator for BlockKind enum in libcraft-blocks
  • Generator for EntityKind enum in libcraft-core
  • Generator for Item enum in libcraft-items
  • Generator for SimplifiedBlockKind enum in libcraft-blocks
  • Generator for Particle enum in libcraft-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 the minecraft-data subdirectory, which is a Git submodule. Make sure that Git submodules are up to date before running the scripts.
  • libcraft-data directory contains custom data files, made especially for libcraft.
  • raw_block_states generator uses block state data generated by the vanilla minecraft server.jar
    • The block state data can be generated by downloading the server.jar and running java -cp server.jar net.minecraft.data.Main --all