Minetest-WorldEdit
Minetest-WorldEdit copied to clipboard
Allow the wielded item to be specified in commands
The implementation for https://github.com/Uberi/Minetest-WorldEdit/issues/249
It use either w
or wielded
for using the user wielded object. It properly check for all possible case of error I can think of, and is not available in the GUI.
(I think that replacing the w
or wielded
text with the currently wielded item would avoid the complexity of refreshing the UI whenever the player change item, but it also mean understanding how to set the GUI searchbox.)
It’s the first time I code on a Minetest mod.
I modified the function signature in a way that should allow mods that does not provide the playername keep working, and mods that does provide the playername with an older worldedit version also works.