Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3526

PrepareItemCraftEvent#getInventory().setResult(ItemStack) weird Results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None

      I tried to create Custom Recipes with specific ItemMeta, so Bukkit.addRecipe() wouldn't work. Because of that i decided to check on the PrepareItemCraftEvent if the wanted shape of ItemStacks is placed in the CraftingMatrix and used getInventory().setResult() to set the Custom Result. As long as all ItemStacks in the Matrix have an amount of 1, everything works fine. As soon as one ItemStack has an higher amount than 1, it becomes weird. The amount of all Items with an higher amount than 1 will get reduced by 1 and after that get doubled. So for an example an amount of 5 would result into 8 ((5-1)*2).

       

      I'm not sure if this is a real bug, because i'm not sure if this is the intended way to do something like this.

       

      Some Code to reproduce:

      https://pastebin.com/x1cN7Qqe

            Unassigned Unassigned
            AndaBlock Anda Block
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: