1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

A more robust format for node metadata

This commit is contained in:
Perttu Ahola 2011-04-05 10:59:48 +03:00
parent d1d57cf5c3
commit d6d811f97b
3 changed files with 59 additions and 11 deletions

View file

@ -90,6 +90,19 @@ InventoryItem* InventoryItem::deSerialize(std::istream &is)
}
}
/*
MaterialItem
*/
InventoryItem *MaterialItem::createCookResult()
{
if(m_content == CONTENT_TREE)
{
return new CraftItem("lump_of_coal", 1);
}
return NULL;
}
/*
MapBlockObjectItem
*/
@ -313,6 +326,11 @@ u32 InventoryList::getUsedSlots()
return num;
}
u32 InventoryList::getFreeSlots()
{
return getSize() - getUsedSlots();
}
InventoryItem * InventoryList::getItem(u32 i)
{
if(i > m_items.size() - 1)