mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Move cook result properly to ContentFeatures
This commit is contained in:
parent
f107967fdc
commit
37a5f8a30b
6 changed files with 19 additions and 29 deletions
|
@ -158,12 +158,17 @@ video::ITexture * MaterialItem::getImage(ITextureSource *tsrc) const
|
|||
|
||||
bool MaterialItem::isCookable() const
|
||||
{
|
||||
return item_material_is_cookable(m_content, m_gamedef);
|
||||
INodeDefManager *ndef = m_gamedef->ndef();
|
||||
const ContentFeatures &f = ndef->get(m_content);
|
||||
return (f.cookresult_item != "");
|
||||
}
|
||||
|
||||
InventoryItem *MaterialItem::createCookResult() const
|
||||
{
|
||||
return item_material_create_cook_result(m_content, m_gamedef);
|
||||
INodeDefManager *ndef = m_gamedef->ndef();
|
||||
const ContentFeatures &f = ndef->get(m_content);
|
||||
std::istringstream is(f.cookresult_item, std::ios::binary);
|
||||
return InventoryItem::deSerialize(is, m_gamedef);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue