/** * Sets the material that a character in the recipe shape refers to. * * @param key The character that represents the ingredient in the shape. * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. */ public ShapedRecipe setIngredient(char key, Material ingredient) { return setIngredient(key, ingredient, 0); }
/** * Sets the material that a character in the recipe shape refers to. * * @param key The character that represents the ingredient in the shape. * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. */ public ShapedRecipe setIngredient(char key, MaterialData ingredient) { return setIngredient(key, ingredient.getItemType(), ingredient.getData()); }
for (Entry<String, Map<String, Object>> entry : ingredients.entrySet()) { ItemStack stack = ItemStack.deserialize(entry.getValue()); recipe.setIngredient(entry.getKey().charAt(0), stack.getData());
/** * Sets the material that a character in the recipe shape refers to. * * @param key The character that represents the ingredient in the shape. * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. */ public ShapedRecipe setIngredient(char key, Material ingredient) { return setIngredient(key, ingredient, 0); }
public ShapedRecipie lvl1ArmorHeadRecipie(){ ShapedRecipe recipe = new ShapedRecipe(lvl2Head); recipe.shape("AAA", "ABA", "AAA"); recipe.setIngredient('A', Material.DIAMOND); recipe.setIngredient('B', Material.LEATHER_HELMET); return recipie; } public void lvl1ArmorHead(){ this.getServer().addRecipe(lvl1ArmorHeadRecipie()); //do everything in here normally }
@Override public void setIngredient(char key, MCMaterial mat) { r.setIngredient(key, (Material) mat.getHandle()); }
/** * Sets the material that a character in the recipe shape refers to. * * @param key The character that represents the ingredient in the shape. * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. */ public ShapedRecipe setIngredient(char key, MaterialData ingredient) { return setIngredient(key, ingredient.getItemType(), ingredient.getData()); }
@Override public void setIngredient(char key, MCItemStack ingredient) { r.setIngredient(key, ((ItemStack) ingredient.getHandle()).getType()); }
@SuppressWarnings("deprecated") @Override public void reload(){ enchantedGoldenAppleEffects = getPotionEffects("napple"); goldenAppleEffects = getPotionEffects("gapple"); try{ r = new ShapedRecipe(new NamespacedKey(plugin, "MINECRAFT"), napple); } catch(NoClassDefFoundError e){ r = new ShapedRecipe(napple); } r.shape("ggg", "gag", "ggg").setIngredient('g', Material.GOLD_BLOCK).setIngredient('a', Material.APPLE); registerCrafting(); }
shaped.setIngredient('@', Material.COBBLESTONE);
public void register() { if (this.result == null || this.ingredients == null) { return; } while (this.register) { this.unregister(); } ShapedRecipe recipe = new ShapedRecipe(this.result); recipe.shape("123", "456", "789"); this.patcher(); for (Integer i = 1; i < 10; i++) { if (this.ingredients[i - 1] != null && !(this.ingredients[i - 1].getType() == Material.AIR)) { recipe.setIngredient((i.toString()).charAt(0), this.ingredients[i - 1].getType()); } } this.recipe = recipe; Bukkit.addRecipe(recipe); this.register = true; }
shapedRecipe.setIngredient(e.getValue(), e.getKey().getData());
return false; shaped.setIngredient(key.charAt(0), material); ingredients.put(key.charAt(0), ingredient);
String[] recipe_iddata = plugin.getRecipesConfig().getString("shaped." + s + "." + difficulty + "_ingredients." + g).split(":"); Material m = Material.valueOf(recipe_iddata[0]); r.setIngredient(c, m); }); } catch (IllegalArgumentException e) {