Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

My Luanti open-source contributions so far

I'm not here to list all my mods that I use in my Luanti Mineclonia world, but I am going to talk about the work I've done to try to help the ecosystem.

I wrote a very small mod named list_to_file that dumps active users to a file, so I can use server-side scripts to render that into a dashboard for myself. That's a separate topic for a separate time. I also brought in a few functions from the forum that list the items in their respective files: items-nodes.txt, items-tools.txt, and items-crafts.txt. Small stuff that average users wouldn't need. I was struggling with the names of nodes for giving myself "mapserver:poi_green" for example. Shoulda gone to creative mode, too late now.

I found mod inventory_pouches ideal for my small server, and I had to fix a few bugs, including the dye colors for Mineclonia, and losing contents upon server restart (which defeats most of the purpose of such a mod). That fix took me 3 hours of intense debugging, only to realize the only change that was necessary was changing a lua loop for i, stack_table in ipairs(inv_table) to pairs(inv_table). That's it. One character. I added tons of debugging and helper functions to narrow down the problem. I wonder if the lua/luanti syntax changed or if this mod has always been broken.

And then I hacked mod inventory_icon to include the inventory pouches. That took less work than debugging the pouches to persist across game restarts, although I'm still not 100% certain the icon placement in the HUD is bulletproof. But hopefully people will find my changes useful.

Appendix

A quick way to view what is a git repo in that directory.

[luanti@server4|/home/luanti/.minetest/mods]$ find . -maxdepth 2 -iname '.git' -printf '%h\n' | while read dir ; do ( cd "${dir}" ; git remote -v ; ) | sed -r -e "s@^@${dir} @" ; done | column -t | grep fetch
./dumpnodes          origin       https://github.com/Montandalar/dumpnodes              (fetch)
./list_to_file       gitlab       https://gitlab.com/bgstack15/list_to_file.git         (fetch)
./list_to_file       origin       http://server3/git/list_to_file                       (fetch)
./inventory_pouches  github       https://github.com/JamesClarke7283/inventory_pouches  (fetch)
./inventory_pouches  github_mine  https://github.com/bgstack15/inventory_pouches        (fetch)
./inventory_pouches  origin       http://server3/git/inventory_pouches                  (fetch)
./inventory_icon     codeberg     https://codeberg.org/Wuzzy/minetest_inventory_icon    (fetch)
./inventory_icon     origin       http://server3/git/minetest_inventory_icon            (fetch)

Comments