java类org.bukkit.inventory.ShapedRecipe的实例源码

CraftShapedRecipe.java 文件源码 项目:Uranium 阅读 25 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftListener.java 文件源码 项目:Bags2 阅读 20 收藏 0 点赞 0 评论 0
@EventHandler
public void onCraft(CraftItemEvent e)
{
    Player p = (Player) e.getWhoClicked();
    if(e.getRecipe() instanceof ShapedRecipe)
    {
        ShapedRecipe sr = (ShapedRecipe) e.getRecipe();
        if(Bukkit.getBukkitVersion().contains("1.11"))
        {
            for(BagBase  bb : Util.getBags())
            {
                if(((ShapedRecipe)bb.getRecipe()).getShape().equals(sr.getShape()))
                {
                    if(!hasPermission(new Permission("bag.craft." + bb.getName(), PermissionDefault.TRUE), p))
                    e.setCancelled(true);                   
                }
            }
        }
        else
        if(sr.getKey().getNamespace().startsWith("bag_"))
        {
            if(!hasPermission(new Permission("bag.craft." + sr.getKey().getKey(), PermissionDefault.TRUE), p))
            e.setCancelled(true);
        }
    }
}
CraftShapedRecipe.java 文件源码 项目:ThermosRebased 阅读 27 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:Brynhildr 阅读 22 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getKey(), recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
RecipeUtil.java 文件源码 项目:Enhanced-Items 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Shapes a recipe from an {@link EnhancedItem} {@link Recipe} and registers it
 * 
 * @param recipe The recipe to shape and register
 */
public static void registerShapedRecipe(Recipe recipe)
{
    String top = recipe.getTop();
    String mid = recipe.getMid();
    String bot = recipe.getBot();

    ItemStack itemStack = EnhancedItemUtil.createItem(recipe.getOutput(), null);

    ShapedRecipe shapedRecipe = new ShapedRecipe(itemStack);
    shapedRecipe.shape(top, mid, bot);
    shapedRecipe = recipe.shapeRecipe(shapedRecipe);

    EnhancedItems.getInstance().getServer().addRecipe(shapedRecipe);
    EnhancedItems.getInstance().addRecipe(recipe);
}
Injector.java 文件源码 项目:Carbon-2 阅读 26 收藏 0 点赞 0 评论 0
public void registerRecipes() {
    Bukkit.resetRecipes();
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.BEETROOT_SOUP)).shape(new String[] {"rrr", "rrr", " b "}).setIngredient('r', MaterialList.BEETROOT).setIngredient('b', org.bukkit.Material.BOWL));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.END_BRICKS)).shape(new String[] {"ee", "ee"}).setIngredient('e', org.bukkit.Material.ENDER_STONE));

    //Purpur block recipes
    addRecipe(new FurnaceRecipe(new ItemStack(MaterialList.CHORUS_FRUIT_POPPED), MaterialList.CHORUS_FRUIT));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_BLOCK, 4)).shape(new String[] {"pp", "pp"}).setIngredient('p', MaterialList.CHORUS_FRUIT_POPPED));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"p  ", "pp ", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"  p", " pp", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_SLAB, 6)).shape(new String[] {"ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_PILLAR)).shape(new String[] {"s", "s"}).setIngredient('s', MaterialList.PURPUR_SLAB));

    //Arrows
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.SPECTRAL_ARROW, 2)).shape(new String[] {" d ", "dad", " d "}).setIngredient('d', org.bukkit.Material.GLOWSTONE_DUST).setIngredient('a', org.bukkit.Material.ARROW));
}
CraftShapedRecipe.java 文件源码 项目:Thermos 阅读 22 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:KCauldron 阅读 19 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:CauldronGit 阅读 19 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:Cauldron-Old 阅读 20 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:Cauldron-Reloaded 阅读 20 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
RecipeManager.java 文件源码 项目:SurvivalCG 阅读 23 收藏 0 点赞 0 评论 0
public RecipeManager(SCG plugin ){
    this.plugin = plugin;
    ItemStack ender = new ItemStack(Material.ENDER_STONE);
    ShapedRecipe enderRecipe = new ShapedRecipe(ender);
    enderRecipe.shape("*S*","SPS","*S*");
    enderRecipe.setIngredient('*', Material.REDSTONE);
    enderRecipe.setIngredient('S', Material.STONE);
    enderRecipe.setIngredient('P', Material.PISTON_BASE);
    Bukkit.addRecipe(enderRecipe);

    ItemStack enderChest = new ItemStack(Material.ENDER_CHEST);
    ShapedRecipe enderChestRecipe = new ShapedRecipe(enderChest);
    enderChestRecipe.shape("***","*P*","***");
    enderChestRecipe.setIngredient('*', Material.OBSIDIAN);
    enderChestRecipe.setIngredient('P', Material.ENDER_PEARL);
    Bukkit.addRecipe(enderChestRecipe);

  //  ItemStack obsidian = new ItemStack(Material.OBSIDIAN);
  //  ShapedRecipe obsidianRecipe = new ShapedRecipe(obsidian);
   // obsidianRecipe.shape("***","***","***");
   // obsidianRecipe.setIngredient('*', Material.COBBLESTONE);
   // Bukkit.addRecipe(obsidianRecipe);
}
CraftShapedRecipe.java 文件源码 项目:FFoKC 阅读 21 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:CraftBukkit 阅读 18 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
GameManager.java 文件源码 项目:Ultra-Hardcore-1.8 阅读 20 收藏 0 点赞 0 评论 0
public void updateGoldenHead() {
    if (gA.mC.cLa) {
        List<ShapedRecipe> a = new ArrayList<>();
        if (gA.mC.cLb) {
            if (!isRecipeEx(gG.get(0).getResult())) {
                gA.getServer().addRecipe(gG.get(0));
            }
        } else {
            a.add(gG.get(0));
        }
        if (gA.mC.cLc) {
            if (!isRecipeEx(gG.get(1).getResult())) {
                gA.getServer().addRecipe(gG.get(1));
            }
        } else {
            a.add(gG.get(1));
        }
        if (a.size() != 0) {
            removeGoldenHead(a);
        }
    } else {
        removeGoldenHead(gG);
    }
}
CraftShapedRecipe.java 文件源码 项目:Craftbukkit 阅读 22 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
Injector.java 文件源码 项目:Carbon-2 阅读 20 收藏 0 点赞 0 评论 0
public void registerRecipes() {
    Bukkit.resetRecipes();
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.BEETROOT_SOUP)).shape(new String[] {"rrr", "rrr", " b "}).setIngredient('r', MaterialList.BEETROOT).setIngredient('b', org.bukkit.Material.BOWL));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.END_BRICKS)).shape(new String[] {"ee", "ee"}).setIngredient('e', org.bukkit.Material.ENDER_STONE));

    //Purpur block recipes
    addRecipe(new FurnaceRecipe(new ItemStack(MaterialList.CHORUS_FRUIT_POPPED), MaterialList.CHORUS_FRUIT));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_BLOCK, 4)).shape(new String[] {"pp", "pp"}).setIngredient('p', MaterialList.CHORUS_FRUIT_POPPED));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"p  ", "pp ", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"  p", " pp", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_SLAB, 6)).shape(new String[] {"ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_PILLAR)).shape(new String[] {"s", "s"}).setIngredient('s', MaterialList.PURPUR_SLAB));

    //Arrows
    addRecipe(new ShapedRecipe(new ItemStack(MaterialList.SPECTRAL_ARROW, 2)).shape(new String[] {" d ", "dad", " d "}).setIngredient('d', org.bukkit.Material.GLOWSTONE_DUST).setIngredient('a', org.bukkit.Material.ARROW));
}
Saw.java 文件源码 项目:BelovedBlocks 阅读 22 收藏 0 点赞 0 评论 0
@Override
public Iterable<Recipe> getCraftingRecipes()
{
    ArrayList<Recipe> recipes = new ArrayList<>();

    ShapedRecipe baseRecipe = CraftingRecipes.shaped(makeItem(1), Material.STICK, Material.IRON_INGOT);

    recipes.add(CraftingRecipes.shaped(baseRecipe, "BBA", "   ", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "BBA", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "   ", "BBA"));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "ABB", "   ", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "ABB", "   "));
    recipes.add(CraftingRecipes.shaped(baseRecipe, "   ", "   ", "ABB"));

    return recipes;
}
ConfigRemovedRecipes.java 文件源码 项目:civcraft 阅读 17 收藏 0 点赞 0 评论 0
public static void removeRecipes(FileConfiguration cfg, HashMap<Integer, ConfigRemovedRecipes> removedRecipies){

    List<Map<?, ?>> configMaterials = cfg.getMapList("removed_recipes");
    for (Map<?, ?> b : configMaterials) {
        ConfigRemovedRecipes item = new ConfigRemovedRecipes();
        item.type_id = (Integer)b.get("type_id");
        item.data = (Integer)b.get("data");

        removedRecipies.put(item.type_id, item);

        Iterator<Recipe> it = Bukkit.getServer().recipeIterator();
        while (it.hasNext()) {
            Recipe recipe = it.next();

            if (recipe instanceof ShapedRecipe) {
                ShapedRecipe shapedRecipe = (ShapedRecipe)recipe;
                if (ItemManager.getId(shapedRecipe.getResult()) == item.type_id &&
                        shapedRecipe.getResult().getDurability() == (short)item.data) {
                    it.remove();
                    break;
                }
            }
        }
    }
}
CraftShapedRecipe.java 文件源码 项目:Almura-Server 阅读 21 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
CraftShapedRecipe.java 文件源码 项目:Tweakkit-Server 阅读 21 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
RecipeVerifier.java 文件源码 项目:StarQuestCode 阅读 21 收藏 0 点赞 0 评论 0
Transaction collect(ShapedRecipe recipe) {
    List<ItemStack> collected = new ArrayList<ItemStack>(rows * columns);
    String[] shape = recipe.getShape();
    Map<Character, ItemStack> map = recipe.getIngredientMap();
    for (String s : shape)
        INGREDIENTS: for (int i = 0; i < s.length(); i++) {
            ItemStack ingredient = map.get(s.charAt(i));
            if (ingredient == null)
                continue;
            for (ItemStack item : collected) {
                if (ItemUtils.itemEqualsTypeAndData(item, ingredient)) {
                    item.setAmount(item.getAmount() + ingredient.getAmount());
                    continue INGREDIENTS;
                }
            }
            collected.add(ingredient);
        }
    return new Transaction(collected, recipe.getResult());
}
CraftingAndRecipes.java 文件源码 项目:CPU 阅读 21 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
static void addRecipes() {
    /**Redstone Apple Recipe**/
    ShapedRecipe redstoneApple = new ShapedRecipe(redstoneApple());
    redstoneApple.shape("XXX",
            "XAX",
            "XXX");
    redstoneApple.setIngredient('X', Material.REDSTONE);
    redstoneApple.setIngredient('A', Material.APPLE);
    Bukkit.getServer().addRecipe(redstoneApple);

    /**Redstone Activator Recipe**/
    ShapedRecipe Activator = new ShapedRecipe(redstoneActivator());
    Activator.shape("XXX",
            "XXX",
            "XXX");
    Activator.setIngredient('X', Material.APPLE, (short) 1000);
    Bukkit.getServer().addRecipe(Activator);
}
CraftShapedRecipe.java 文件源码 项目:Cauldron 阅读 24 收藏 0 点赞 0 评论 0
public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
    if (recipe instanceof CraftShapedRecipe) {
        return (CraftShapedRecipe) recipe;
    }
    CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
    String[] shape = recipe.getShape();
    ret.shape(shape);
    Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
    for (char c : ingredientMap.keySet()) {
        ItemStack stack = ingredientMap.get(c);
        if (stack != null) {
            ret.setIngredient(c, stack.getType(), stack.getDurability());
        }
    }
    return ret;
}
ManCo.java 文件源码 项目:manco2 阅读 17 收藏 0 点赞 0 评论 0
public void loadRecipes() {
    ItemStack stack = new ItemStack(Material.STONE, 1);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName("crate");
    stack.setItemMeta(meta);
    ShapedRecipe recipe1 = new ShapedRecipe(stack);
    recipe1.shape(new String[] {
            "AAA",
            "ABA",
            " A "
    });
    recipe1.setIngredient('A', Material.IRON_INGOT);
    recipe1.setIngredient('B', Material.GOLD_INGOT);

    ShapedRecipe recipe2 = new ShapedRecipe(stack);
    recipe2.shape(new String[] {
            "AAA",
            "ACA",
            " A "
    });
    recipe2.setIngredient('A', Material.IRON_INGOT);
    recipe2.setIngredient('C', Material.DIAMOND);

    Bukkit.addRecipe(recipe1);
    Bukkit.addRecipe(recipe2);
}
RecipeFeature.java 文件源码 项目:ultrahardcore 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Add our recipes
 */
@Override
protected void enableCallback()
{
    //Make a recipe that will return a golden carrot when the right shape is made
    ShapedRecipe newGoldenCarrot = new ShapedRecipe(new ItemStack(Material.GOLDEN_CARROT, 1));
    //8 gold ingots surrounding an apple
    newGoldenCarrot.shape("AAA", "ABA", "AAA");
    newGoldenCarrot.setIngredient('A', Material.GOLD_INGOT);
    newGoldenCarrot.setIngredient('B', Material.CARROT_ITEM);
    Bukkit.addRecipe(newGoldenCarrot);

    //Make the recipe for glistering melons minus a set shape (glistering melon is speckled melon in code
    ShapelessRecipe newGlisteringMelon = new ShapelessRecipe(new ItemStack(Material.SPECKLED_MELON, 1));
    //1 gold ingot with a melon
    newGlisteringMelon.addIngredient(Material.GOLD_BLOCK);
    newGlisteringMelon.addIngredient(Material.MELON);
    Bukkit.addRecipe(newGlisteringMelon);
}
AutoBuilder.java 文件源码 项目:sensibletoolbox 阅读 21 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    ToughMachineFrame mf = new ToughMachineFrame();
    IntegratedCircuit ic = new IntegratedCircuit();
    registerCustomIngredients(mf, ic);
    recipe.shape("OCO", "DFP", "RGR");
    recipe.setIngredient('O', Material.OBSIDIAN);
    recipe.setIngredient('C', ic.getMaterialData());
    recipe.setIngredient('D', Material.DISPENSER);
    recipe.setIngredient('F', mf.getMaterialData());
    recipe.setIngredient('P', Material.DIAMOND_PICKAXE);
    recipe.setIngredient('R', Material.REDSTONE);
    recipe.setIngredient('G', Material.GOLD_INGOT);
    return recipe;
}
InjectorManager.java 文件源码 项目:VisloBlock 阅读 22 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
private static void injectRecipes()
{
    ShapedRecipe slimeBlock = new ShapedRecipe(new ItemStack(
            Material.getMaterial("slime"))).shape(
            new String[] { "###", "###", "###" }).setIngredient('#',
            Material.SLIME_BALL);
    Bukkit.getServer().addRecipe(slimeBlock);
    ShapelessRecipe deslimeBlock = new ShapelessRecipe(new ItemStack(
            Material.SLIME_BALL, 9));
    deslimeBlock.addIngredient(Material.getMaterial("slime"));
    Bukkit.getServer().addRecipe(deslimeBlock);

    ShapedRecipe redSandStone = new ShapedRecipe(new ItemStack(Material.getMaterial("red_sandstone")))
            .shape(new String[] { "   ", "## ", "## " }).setIngredient('#',
                    Material.SAND, 1);
    Bukkit.getServer().addRecipe(redSandStone);

}
PokeEgg.java 文件源码 项目:WC 阅读 16 收藏 0 点赞 0 评论 0
public void registerRecipe(){
    ItemStack i = getPokeEgg();

    ShapedRecipe pokeEgg = new ShapedRecipe(i);

    pokeEgg.shape("BAB", "DCD", "BAB");

    pokeEgg.setIngredient('B', Material.WOOL);
    pokeEgg.setIngredient('A', Material.STRING);
    pokeEgg.setIngredient('D', Material.GOLD_NUGGET);
    pokeEgg.setIngredient('C', Material.EGG);

    Bukkit.addRecipe(pokeEgg);
}
PowerCrystal.java 文件源码 项目:SuperiorCraft 阅读 19 收藏 0 点赞 0 评论 0
public PowerCrystal(ItemStack item, String id) {
    super(item, id);

    ShapedRecipe pcrysr = new ShapedRecipe(item);
    pcrysr.shape("=-=",
                 "-#-",
                 "=-=");
    pcrysr.setIngredient('#', Material.DIAMOND);
    pcrysr.setIngredient('-', Material.GOLD_INGOT);
    pcrysr.setIngredient('=', Material.REDSTONE);
    Bukkit.getServer().addRecipe(pcrysr);
}


问题


面经


文章

微信
公众号

扫码关注公众号