[Solved] Add furnace recipe not working?

Discussion in 'Spigot Plugin Development' started by Flamedek, Jun 3, 2015.

  1. Hi, I am trying to add multiple Furnace Recipes to the game.
    However nothing happens in-game, he furnace doesn't activate.

    Code (Text):
            String[] prefixes = { "stone", "iron", "gold", "diamond", "chainmail" };
            String[] suffixes = { "pickaxe", "axe", "sword", "spade", "hoe", "boots", "leggings", "chestplate", "helmet"};
         
            for(String p : prefixes ) {
                for(String s : suffixes) {

                    Material mat = Material.matchMaterial((p + "_" + s).toUpperCase(Locale.ENGLISH));
                 
                    if(mat != null) {

                        FurnaceRecipe recipe = new FurnaceRecipe(result, mat);
                        plugin.getServer().addRecipe(recipe); // Returns true every time
                    }
                }
            }

    EDIT: solved. My reward ItemStack was invalid. (Material.FIRE)
    when changed to a valid material the recipes worked.