[antum] Add function 'antum.getItem':

Retrieves an item from registered items using name string.
This commit is contained in:
AntumDeluge 2017-06-20 20:57:41 -07:00
parent f6571140e7
commit 3b7f6112bb

View File

@ -174,6 +174,23 @@ function antum.dependsSatisfied(depends)
end
--[[
Retrieves an item from registered items using name string.
@param item_name
Item name string to search for
@return
Item object with name matching 'item_name' parameter
]]
function antum.getItem(item_name)
for index in pairs(minetest.registered_items) do
if minetest.registered_items[index].name == item_name then
return minetest.registered_items[index]
end
end
end
--[[
Retrieves a list of items containing a string.