Closed sbrl closed 4 years ago
Since Uberi/Minetest-WorldEdit@91d02f6f5be288c4e225330d362cbaa2a862e723 you can get automatic support for safe_region functionality if you use worldedit.register_command()
. If you do so #4 will also be fixed.
Hey there, @sfan5!
Thanks for the tip!
The last time I tried to hook into the main worldedit safe_region support, I encountered issues that looked an awful lot like Minetest sandboxing my code. Is this now worked around / fixed in the new version of safe_region in regular worldedit, out of curiousity?
Fixing #4 at the same time sounds like a huge win though if I can get that to work though.
Looking at the diff, it looks like it would also reduce code complexity (which is astonishingly easy to come by in Lua lol), so that's another great reason to try switching.
Is this now worked around / fixed in the new version of safe_region in regular worldedit, out of curiousity?
I don't know what exactly you tried, so that's hard to say. But with the "new" code there are no issues with safe_region and third-party worldedit commands.
Just had some time to look into this. Although the changes required were considerable, the resulting code is so much neater! Very well done indeed.
It also took a moment to get my head around the new syntax, but now that I have, it's a brilliantly simple solution!
Thanks so much :D
Currently the chat commands code is getting a bit unwieldy. We should consider refactoring it so that every chat command has it's own file.
Additionally, we should consider ChatCmdBuilder, as it might reduce the amount of code we write & duplicate - and make our code more legible.