This repository contains the tech_api mod, which makes energy delivery and distribution uniform throughout all the mods that use it. This means that if you are creating a Minetest mod that will use/produce/store/carry energy, this API will give you all the tools you need to simplify your life and make your creation compatible with all the other mods that use it.
It has been written with the Technic mod in mind since it needed a more performant energy system. This means that the API fully supports energy tiers, devices connected to more than one network, etc...
Also, in the future, it may be extended to provide useful methods to deal with items and fluids (i.e. pipes and tubes compatible between different mods), but the focus is currently on power distribution.
The API is not yet complete, but it can already be used to play around and should provide all the planned features without any problem. Actually, playing around with it is really encouraged so bugs can be found and fixed and the development can continue.
The API methods and working principles, however, shouldn't change in the near future, so you may already start developing something with it. The main things left to do are just to ensure better stability and reliability.
You can check out the tech_api_demo mod to play around with the API and see how to actually implement something. This may be your best way to learn how to use it until a tutorial is ready.
The code is well documented using LDoc. To have in-depth documentation of the
Lua code, you can run the script generate-doc.sh
, which will generate HTML
pages for the various modules. Then you can open ldoc/index.html
.
Obviously you must have LDoc installed along with its requirements. Follow the
instructions here.
If you don't care about pretty docs then you can just go through the code and follow the comments.
You can contribute by creating an issue (or participating to the already open ones). If you want to help directly with the code, just fork the repository and make a pull request.
Thank you!