Querz / mcaselector

A tool to select chunks from Minecraft worlds for deletion or export.
MIT License
3.21k stars 175 forks source link

making custom filters more powerful #443

Closed arvitus closed 3 months ago

arvitus commented 1 year ago

As far as I know, the custom filters are currently limited to groovy and java builtin classes and the NBT library, not allowing for json read/write operations on files for example.

This PR aims to solve that. It implements the possibility to make custom import statements based on the libraries that mca uses. (Maybe even past that) Instead of only being able to write the code that is put inside the filter function, you can now define the filter function itself inside of the custom filter, allowing for imports before that definition.

This is also useful for extending the custom filter functionality even more, for example by adding some kind of hook functions "before" and "after" that will be called once before the filtering process starts and after it ends. That way one could define all those three functions in the custom filter, making it even more powerful.