dennisjenkins75 / digiline_craftdb

Minetest mod for a digiline queryable database holding all regular and technic crafting recipes.
GNU General Public License v3.0
2 stars 2 forks source link

search for groups #3

Closed SwissalpS closed 3 years ago

SwissalpS commented 3 years ago

Following the example of the readme, I looked up stone pickaxe. For this I need group:stone and default:stick.

Sticks I can set in autocrafter but group:stone not, so I looked up 'group:stone' and got nothing in return.

Is the intended use to now ask mithril chest how many 'group:stone' it has in inventory? That is the work-around I can see right now.

If autocrafters could deal with groups, then this lookup method would also be less interesting to implement.

Just a thought :)

dennisjenkins75 commented 3 years ago

Good point. It should be possible to ask the craftdb for all items that are members of a given group.

Should that just be a special case handling of item = 'group:foo' in the existing find API, or a new API.. Thoughts?

SwissalpS commented 3 years ago

other mods do something like this:

local stack = ItemStack(msg)

I think a look at injector helps get a feel for naming scheme to use. It helps when same fields are used to mean same things accross mods.