Note: The most part of the code will be transformed to C++, so the project might be dhlrcpp in the future.
Although it was named as litematica_reader_c
, it's not only intended to read litematica file, but process the material list in blocks in a litematica file region. Reading litematica file is just the first step to process, or in other words there should be a source of material list to process, and reading a litematica file is the most convenient.
It uses libnbt as the library to read litematica file.
Since it's a general-purpose project, the assets
and data
file should be provided by user. Luckily, there's a simple wizard in utility
in Qt module which helps you to do this.
- libnbt (already in submodule of the repo)
zlib
- cJSON
>= 1.7.13
gettext
(It's a part ofglibc
so you might not need to install it in GNU/Linux but other systems might need)(Optional -- if you need translation)glib2
minizip-ng
- dhutil (already in submodule of the repo)
Use git
to get this repo, then get submodule.
git submodule update --init
If there's already CMake installed, just compile using command:
cmake -B build
cmake --build build
If not, install one.
- NBT management (NBT
interface
support and NBT Reader). Note: if you want to modify the content, you might need to use theget_current_nbt
method and modify by yourself. - Partly support of
NBT Struct
andLitematic
using generalRegion
. Note: support easily read block state and palette, generate block list (Although it's called item list), generateNBT Struct
fromRegion
. - Partly recipe support
- Customize module
Note: see
For developer
.
Just run dhlrc.bin
, and the Qt backend will start unless you are using Linux tty.
If you just want to convert file, just run dhlrc.bin conv --help
and do with the instruction.
The program uses launcher
to load module, if you want to add new module for the program, just implement the 5 functions below and compile it as library (or executable?), and put it under module
:
extern const char* module_name();
extern DhStrArray* module_name_array();
extern const char* module_description();
extern const char* help_description();
extern int start_point(int argc, char** argv, const char* prpath);
WARNING: Add extern "C"
in C++ project! Otherwise it couldn't be recognized!