PrepareItemCraftEvent#isRepair() seems to always return false in 1.20

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:

      Tested in spigot 1.19 and 1.20

       

    • CraftBukkit version 4014-Spigot-864e4ac-771182f (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
    • Yes

      PrepareItemCraftEvent#isRepair() seems to always return false on 1.20 versions of spigot, making it unreliable in checking if the current recipe is a repairing recipe. On 1.19 this seems to work properly

       

      The following code used:

      @EventHandler(priority = EventPriority.HIGHEST)public void onPrepareCraft(PrepareItemCraftEvent e){ System.out.println("is repair: " + e.isRepair());

      {color:#cc7832}}

      On 1.20 the following recipe

      returns

      On 1.19 this returns true instead.

       

      A workaround is checking if all items in the grid are identical, with max durabilities greater than 0.

            Assignee:
            Unassigned
            Reporter:
            Athlaeos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: