Clicking an empty anvil result slot no longer errors

This commit is contained in:
Aria 2019-12-18 19:24:22 +01:00
parent a4477415ed
commit 6888630355

View File

@ -60,6 +60,7 @@ public class RepairItemExperienceSource extends ExperienceSource<ItemStack> {
* before getting the amount of durability repaired * before getting the amount of durability repaired
*/ */
ItemStack old = event.getInventory().getItem(0); ItemStack old = event.getInventory().getItem(0);
if (old == null || old.getType() == Material.AIR) return;
if (old.getType().getMaxDurability() < 30 || item.getType().getMaxDurability() < 10) if (old.getType().getMaxDurability() < 30 || item.getType().getMaxDurability() < 10)
return; return;