Adding create() function for recipes - creates but does not add (see updated listing in book chapter 16)
This commit is contained in:
parent
062886d8e6
commit
6b6c8f6dfe
1 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,9 @@ var cmRecipe = cm.api.inventory.recipes.CraftingRecipe;
|
|||
var cmRecipeRow = cm.api.inventory.recipes.RecipeRow;
|
||||
|
||||
function addRecipe( recipe ){
|
||||
return server.addRecipe( createRecipe( recipe ) );
|
||||
}
|
||||
function createRecipe( recipe ){
|
||||
if (!recipe){
|
||||
return null;
|
||||
}
|
||||
|
@ -32,5 +35,6 @@ function addRecipe( recipe ){
|
|||
function removeRecipe( recipe ){
|
||||
server.removeRecipe( recipe );
|
||||
}
|
||||
exports.create = createRecipe;
|
||||
exports.add = addRecipe;
|
||||
exports.remove = removeRecipe;
|
||||
|
|
Reference in a new issue