CraftInput createInput(const CraftPointerInput &cpi) { std::vector<std::string> items; for(u32 i=0; i<cpi.items.size(); i++){ if(cpi.items[i] == NULL) items.push_back(""); else{ std::ostringstream oss(std::ios::binary); cpi.items[i]->serialize(oss); items.push_back(oss.str()); } } return CraftInput(cpi.width, items); }
CraftInput CraftDefinitionFuel::getInput(const CraftOutput &output, IGameDef *gamedef) const { std::vector<std::string> rec; rec.push_back(recipe); return CraftInput(CRAFT_METHOD_COOKING,(int)burntime,craftGetItems(rec,gamedef)); }
CraftInput CraftDefinitionToolRepair::getInput(const CraftOutput &output, IGameDef *gamedef) const { std::vector<ItemStack> stack; stack.push_back(ItemStack()); return CraftInput(CRAFT_METHOD_COOKING,additional_wear,stack); }
CraftInput CraftDefinitionShapeless::getInput(const CraftOutput &output, IGameDef *gamedef) const { return CraftInput(CRAFT_METHOD_NORMAL,0,craftGetItems(recipe,gamedef)); }