Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making custom filters more powerful #443

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arvitus
Copy link
Contributor

@arvitus arvitus commented Aug 29, 2023

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.

- changed filter function name to "filter"
- made additional imports possible (limited to the libs that mca uses) by allowing to define the filter function in the filter string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant