MCPcopy Create free account
hub / github.com/cuberite/cuberite / CanCookInputToOutput

Method CanCookInputToOutput

src/BlockEntities/FurnaceEntity.cpp:408–435  ·  view source on GitHub ↗

Returns true if the input can be cooked into output and the item counts allow for another cooking operation

Source from the content-addressed store, hash-verified

406
407/// Returns true if the input can be cooked into output and the item counts allow for another cooking operation
408bool cFurnaceEntity::CanCookInputToOutput(void) const
409{
410 if (m_CurrentRecipe == NULL)
411 {
412 // This input cannot be cooked
413 return false;
414 }
415
416 if (m_Contents.GetSlot(fsOutput).IsEmpty())
417 {
418 // The output is empty, can cook
419 return true;
420 }
421
422 if (!m_Contents.GetSlot(fsOutput).IsEqual(*m_CurrentRecipe->Out))
423 {
424 // The output slot is blocked with something that cannot be stacked with the recipe's output
425 return false;
426 }
427
428 if (m_Contents.GetSlot(fsOutput).IsFullStack())
429 {
430 // Cannot add any more items to the output slot
431 return false;
432 }
433
434 return true;
435}
436
437
438

Callers

nothing calls this directly

Calls 4

IsEqualMethod · 0.80
IsFullStackMethod · 0.80
IsEmptyMethod · 0.45
GetSlotMethod · 0.45

Tested by

no test coverage detected