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
Aaron 893dbd6aaa Fixed bukkit version of recipes.js module
I was having trouble adding recipes to my bukkit server using ScriptCraft.  It looks like the example in js/modules/recipes.js only works on a CanaryMod server, and the original version of js/modules/bukkit/recipes.js caused type related errors and didn't seem to implement Spigot/Bukkit methods properly.  With these changes I can now create a custom recipe and add it to the server with the following (note that the recipes.add() function both creates a bukkit ShapedRecipe AND adds the recipe to the server):

var items = require("items");
var recipes = require("recipes");
var events = require("events");

var bow = items.bow(1);
var tnt = items.tnt(1);
var explodeBow = items.bow(1);

var explodeBowMeta = explodeBow.getItemMeta();
explodeBowMeta.setDisplayName("Bow of Exploding");
explodeBowMeta.setLore(["Excite. Very boom."]);
explodeBow.setItemMeta(explodeBowMeta);

var explodeBowRecipe = recipes.add(
{
    result: explodeBow,
    ingredients: {B: bow, T: tnt},
    shape: ["   ", "TB ", "   "]
});
2015-10-02 15:55:31 -07:00
..
java Just fixed formatting for better readability, no real changes. 2015-04-19 16:40:06 +02:00
js Fixed bukkit version of recipes.js module 2015-10-02 15:55:31 -07:00
resources Use ScriptCraft as name of plugin 2015-03-01 13:52:48 +00:00