aboutsummaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-16 02:22:41 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:46 +0200
commit6a417c538f0af9e611d6f94cfb12d36f51982db8 (patch)
tree1bb137c17d3ca90e7cacbf27f810f26c29f50712 /src/inventory.cpp
parent7fae32095a843662dad77bd580a6a11637a53fe8 (diff)
downloadminetest-6a417c538f0af9e611d6f94cfb12d36f51982db8.tar.xz
Remove burn time definitions from FurnaceNodeMetadata
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))