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;
|
var cmRecipeRow = cm.api.inventory.recipes.RecipeRow;
|
||||||
|
|
||||||
function addRecipe( recipe ){
|
function addRecipe( recipe ){
|
||||||
|
return server.addRecipe( createRecipe( recipe ) );
|
||||||
|
}
|
||||||
|
function createRecipe( recipe ){
|
||||||
if (!recipe){
|
if (!recipe){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -32,5 +35,6 @@ function addRecipe( recipe ){
|
||||||
function removeRecipe( recipe ){
|
function removeRecipe( recipe ){
|
||||||
server.removeRecipe( recipe );
|
server.removeRecipe( recipe );
|
||||||
}
|
}
|
||||||
|
exports.create = createRecipe;
|
||||||
exports.add = addRecipe;
|
exports.add = addRecipe;
|
||||||
exports.remove = removeRecipe;
|
exports.remove = removeRecipe;
|
||||||
|
|
Reference in a new issue