int on_craft( object * materials )

Called whenever an object is crafted, passing in an array of the materials
which were used. If you return 0, then the materials will be destructed
immediately after this function returns, and the crafting message will
be printed. If you return non-zero, the materials will be moved inside
of this object immediately after the function returns, and no message
will be printed. This is useful for configuring the object after
crafting has taken place, and allows you to return the materials to the
player if they cancel the crafting.
