[antum] Add function 'antum.getItem':
Retrieves an item from registered items using name string.
This commit is contained in:
parent
f6571140e7
commit
3b7f6112bb
@ -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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user