+struct ICraftAction : public InventoryAction
+{
+ // count=0 means "everything"
+ u16 count;
+ InventoryLocation craft_inv;
+
+ ICraftAction()
+ {
+ count = 0;
+ }
+
+ ICraftAction(std::istream &is);
+
+ u16 getType() const
+ {
+ return IACTION_CRAFT;
+ }
+
+ void serialize(std::ostream &os) const
+ {
+ os<<"Craft ";
+ os<<count<<" ";
+ os<<craft_inv.dump()<<" ";
+ }
+
+ void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef);
+
+ void clientApply(InventoryManager *mgr, IGameDef *gamedef);
+};
+
+// Crafting helper
+bool getCraftingResult(Inventory *inv, ItemStack& result,
+ bool decrementInput, IGameDef *gamedef);
+