summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 6d0a2a214..98bf57738 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -171,6 +171,20 @@ InventoryItem *MaterialItem::createCookResult() const
return InventoryItem::deSerialize(is, m_gamedef);
}
+float MaterialItem::getCookTime() const
+{
+ INodeDefManager *ndef = m_gamedef->ndef();
+ const ContentFeatures &f = ndef->get(m_content);
+ return f.furnace_cooktime;
+}
+
+float MaterialItem::getBurnTime() const
+{
+ INodeDefManager *ndef = m_gamedef->ndef();
+ const ContentFeatures &f = ndef->get(m_content);
+ return f.furnace_burntime;
+}
+
/*
ToolItem
*/
@@ -258,6 +272,18 @@ InventoryItem *CraftItem::createCookResult() const
return item_craft_create_cook_result(m_subname, m_gamedef);
}
+float CraftItem::getCookTime() const
+{
+ return 3.0;
+}
+
+float CraftItem::getBurnTime() const
+{
+ if(m_subname == "lump_of_coal")
+ return 40;
+ return -1;
+}
+
bool CraftItem::use(ServerEnvironment *env, ServerActiveObject *user)
{
if(!item_craft_is_eatable(m_subname, m_gamedef))