mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
A more robust format for node metadata
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user