[SPIGOT-7570] PrepareItemCraftEvent#isRepair() seems to always return false in 1.20 Created: 17/Jan/24 Updated: 25/Dec/24 Resolved: 18/Jan/24 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Athlaeos | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | api, bug, crafting, repairing | ||
| Environment: |
Tested in spigot 1.19 and 1.20
|
||
| Attachments: |
|
| Version: | CraftBukkit version 4014-Spigot-864e4ac-771182f (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
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}} 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. |