Developer guide
Manual build
-
Clone Craftium's repo and
cdinside. Make sure that you have the build dependencies installed (see Installation). -
Build the Luanti engine:
cmake . -DRUN_IN_PLACE=TRUE -DCMAKE_BUILD_TYPE=Release make -j$(nproc) -
Build
mt_server.clibrary:gcc -shared -o mt_server.so -fPIC $(python3 -m pybind11 --includes) mt_server.c -I/usr/include/python3.11 -I$(python3 -c "import numpy; print(numpy.get_include())") -lpython3.11Note: Replace the python version with the one corresponding to your system.
Done! Note that these steps don't install Craftium, they just build all its components, but you can use Craftium inside the project's directory.
Updating Craftium to new Luanti versions
Luanti, the game engine Craftium is based on, gets updated Instructions to update Craftium to a new Luanti version.
-
Add the Luanti repo as a new remote repo (
upstream) if it isn't already included (you can checkgit remote -v):git remote add upstream git@github.com:luanti-org/luanti.git -
Fetch all tags from the
upstreamremote:git fetch upstream --tagsAfter this step, running
git tag -lshould list all the available Luanti tags. -
Merge the Luanti tag into the current branch:
git merge <version-tag>Where
<version-tag>is the tag of the version you want to update Craftium to, for example:5.10.0. This last command will merge as many changes as possible, but some might conflict with the Craftium's modifications to Luanti. Check the command's output to get the list of conflicts. You can also check conflicts from theUnmerged pathssection ofgit status. -
After resolving the conflicts, check that all Craftium functionalities continue to work and commit the changes. Note that Craftium doesn't have unit tests yet, so any pull request updating Craftium to a new Luanti version will have to be manually checked.
Building Craftium as a Python wheel
This method employs uv and docker, so please be sure to have a proper installation of both tools in your system before trying to build the wheel.
Once uv and docker are set up, just call CIBW_SKIP="*-musllinux_*" uvx cibuildwheel --platform linux inside the cloned craftium repo. After a while (+ 10mins), the Python wheels will be located inside a new wheelhouse/ directory in the current path.
Locally serving the docs
To serve craftium's docs locally, run:
uv run --group docs mkdocs serve
This command will serve craftium's documentation in http://127.0.0.1:8000/ by default.