This repository has been archived on 2021-07-14. You can view files and clone it, but cannot push or open issues or pull requests.
scriptcraft/src/main/js/modules/bukkit/recipes.js

16 lines
491 B
JavaScript
Raw Normal View History

var items = require('items');
var bkShapedRecipe = org.bukkit.inventory.ShapedRecipe;
exports.add = function( recipe ){
var result = new bkShapedRecipe( recipe.result );
result.shape(recipe.shape[0], recipe.shape[1], recipe.shape[2]);
for (var i in recipe.ingredients ){
result.setIngredient( new java.lang.Character(i), recipe.ingredients[i].getData() );
}
server.addRecipe(result);
return result;
};
exports.remove = function( recipe ) {
server.removeRecipe(recipe);
};