diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 86e00877c..ccd55a79f 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -91,6 +91,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 */ #ifndef SERVER @@ -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) |