forked from Upstream/mmocore
Fixed an issue with paper having durability, like wth spigot
This commit is contained in:
parent
73fbb5844d
commit
560a2def41
@ -196,7 +196,7 @@ public class MMOCoreUtils {
|
||||
*/
|
||||
public static void decreaseDurability(Player player, EquipmentSlot slot, int damage) {
|
||||
ItemStack item = player.getInventory().getItem(slot);
|
||||
if (!item.hasItemMeta() || !(item.getItemMeta() instanceof Damageable) || item.getItemMeta().isUnbreakable())
|
||||
if (item == null || item.getType().getMaxDurability() == 0 || !item.hasItemMeta() || !(item.getItemMeta() instanceof Damageable) || item.getItemMeta().isUnbreakable())
|
||||
return;
|
||||
|
||||
PlayerItemDamageEvent event = new PlayerItemDamageEvent(player, item, damage);
|
||||
|
Loading…
Reference in New Issue
Block a user