mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Fixed error message sometimes displaying when item is repaired by mending
This commit is contained in:
parent
600a53f931
commit
593abcb48e
@ -88,7 +88,11 @@ public class DurabilityListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void mendEvent(PlayerItemMendEvent event) {
|
||||
DurabilityItem durItem = new DurabilityItem(event.getPlayer(), event.getItem());
|
||||
|
||||
// Useless repair amount
|
||||
if (event.getRepairAmount() <= 0) return;
|
||||
|
||||
final DurabilityItem durItem = new DurabilityItem(event.getPlayer(), event.getItem());
|
||||
if (durItem.isValid()) {
|
||||
event.getItem().setItemMeta(durItem.addDurability(event.getRepairAmount()).toItem().getItemMeta());
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user