[dev] how get group from item

foxz
Member
 
Posts: 36
Joined: Sun Feb 07, 2016 11:58
GitHub: foxzoolm
In-game: foxz

[dev] how get group from item

by foxz » Fri Feb 12, 2016 00:18

HI,

I need know all item registered in a group.
coz technic.extractor doesn't understand "group:leaves"...
 

User avatar
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [dev] how get group from item

by kaeza » Fri Feb 12, 2016 00:32

There's no API function to do what you ask, but it's easily done by iterating over `minetest.registered_items` and comparing if the item has the group set and more than zero. I'll leave the coding as an exercise to the reader.

Also, in the future please post modding questions in the Modding Discussion subforum to keep things orderly :) I have moved this one there.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal
 

foxz
Member
 
Posts: 36
Joined: Sun Feb 07, 2016 11:58
GitHub: foxzoolm
In-game: foxz
 


Return to Modding Discussion



Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest