• Type: Bug
    • Resolution: Won't Fix
    • Priority: Major
    • None
    • Affects Version/s: None
    • Environment:

      Windows 7 and Linux (version unknown)

    • Any plugin using the getDurability method on ItemStacks found in Recipies

      When using the method getDurability() on an ItemStack found in a ShapedRecipe and ShaplessRecipe, some things such as cobblestone in the furnace recipie or lapis_block in the lapis block to lapis lazuli have the wrong values.

      In an inventory, these items have a durability of 0. However, in the recipie, these items are found with a durability of Short.MAX_VALUE (32767). Making any comparisons, or any remove from inventory attempt using the ItemStack from a recipie impossible.

      The only temporary fix I can come up with for my plugins are to check:
      if(item.getDurability() == Short.MAX_VALUE)

      { item.setDurability(0);}

      If it matters, I'm getting the recipie using
      this.getServer().getRecipesFor(some_item) where this is my plugin and some_item is an itemstack. I then loop through the list of recipies and attempt to remove the items in them from an inventory.

      With the durability values messed up in the recipes, it is impossible remove without the temporary fix I have (and who knows if that will even work for all recipes).

      I hope I filled out everything in this correctly. If you need more information, please let me know.

            Assignee:
            Thinkofname
            Reporter:
            David McCauley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: