ShapelessRecipe issue?

Discussion in 'Spigot Plugin Development' started by Tikeb, Jun 17, 2016.

  1. Trying to create a new recipe to repair items. The idea being you add a low durability item and a diamond (for example) and the output is the same low durability item fixed to full durability.

    Code (Text):
    ItemStack item = new ItemStack(Material.STONE_PICKAXE);
    ShapelessRecipe recipe = new ShapelessRecipe(item);
    recipe.addIngredient(Material.COBBLESTONE);
    recipe.addIngredient(Material.STONE_PICKAXE);
    The issue is the recipe only works when you add a full durability item to the crafting area. Is there a way to ignore the durability of an item in the crafting area?

    Thanks.
    Tikeb
     
  2. Check the Material instead of the entire ItemStack.
     
  3. As far as I can see the material doesn't have any settings that can be set. The item stack does but that's the output