1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Remove burn time definitions from FurnaceNodeMetadata

This commit is contained in:
Perttu Ahola 2011-11-16 02:22:41 +02:00
parent 7fae32095a
commit 6a417c538f
9 changed files with 79 additions and 87 deletions

View file

@ -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))