-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Implement grouped mode for find_nodes_in_area #9888
Conversation
Good feature, thanks sfan5. |
If anyone feels like testing: it would be interesting to know if this is faster than using a vmanip to read all nodes and then iterating them in Lua. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good optimizations, and the code looks good but lacks of comments.
* First return value: Table with all node positions | ||
* Second return value: Table with the count of each node with the node name | ||
as index. | ||
* If `grouped` is true the return value is a table indexed by node name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the node name be something like 'group:lava' if that was the nodename provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the names returned are always nodes even if you put in a group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I guess a modder could use minetest.get_item_group()
if they wanted to apply to all nodes in a certain group.
I have no problems with this then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works, looks good.
usecase: luanti-org/minetest_game#2683
To do
This PR is Ready for Review.