| 328 | } |
| 329 | |
| 330 | void ContainerObject::startCrafting() { |
| 331 | if (isSlave()) { |
| 332 | world()->sendEntityMessage(entityId(), "startCrafting"); |
| 333 | } else { |
| 334 | if (m_crafting.get()) |
| 335 | return; |
| 336 | auto inputItems = m_items->items(); |
| 337 | inputItems.removeLast(); |
| 338 | m_goalRecipe = recipeForMaterials(inputItems); |
| 339 | m_crafting.set(true); |
| 340 | itemsUpdated(); |
| 341 | // tickCrafting validates |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | void ContainerObject::stopCrafting() { |
| 346 | if (isSlave()) { |
nothing calls this directly
no test coverage detected