mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Do not crash when an exp orb attempts to mend an unrepairable item
This commit is contained in:
parent
8c6ba348c9
commit
69258a8c33
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// CraftBukkit start
|
||||
- org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k);
|
||||
+ // Paper start - mending event
|
||||
+ final int consumedExperience = k * amount / j;
|
||||
+ final int consumedExperience = k > 0 ? k * amount / j : 0;
|
||||
+ org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k, consumedExperience);
|
||||
+ // Paper end - mending event
|
||||
k = event.getRepairAmount();
|
||||
|
|
Loading…
Reference in a new issue