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:
parent
d1d57cf5c3
commit
d6d811f97b
3 changed files with 59 additions and 11 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue