From ad23380c1fa4dfe80bd575b8d6f9703a8718b740 Mon Sep 17 00:00:00 2001 From: ASangarin Date: Sat, 2 Jan 2021 07:35:00 +0100 Subject: [PATCH] Fixed MMOCore not decreasing durability on custom mining/fishing if the item has full durability --- src/main/java/net/Indyuce/mmocore/api/util/MMOCoreUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/util/MMOCoreUtils.java b/src/main/java/net/Indyuce/mmocore/api/util/MMOCoreUtils.java index fa6d0d63..e3cf1e6d 100644 --- a/src/main/java/net/Indyuce/mmocore/api/util/MMOCoreUtils.java +++ b/src/main/java/net/Indyuce/mmocore/api/util/MMOCoreUtils.java @@ -132,7 +132,6 @@ public class MMOCoreUtils { * chunk (worst case border of 4 chunks), the entity will still be included */ public static List getNearbyChunkEntities(Location loc) { - /* * another method to save performance is if an entity bounding box * calculation is made twice in the same tick then the method does not @@ -191,7 +190,6 @@ public class MMOCoreUtils { } public static void heal(LivingEntity target, double value) { - double max = target.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); double gain = Math.min(max, target.getHealth() + value) - target.getHealth(); @@ -220,7 +218,7 @@ public class MMOCoreUtils { return; NBTItem nbt = NBTItem.get(item); - if (!nbt.getBoolean("Unbreakable") && item.hasItemMeta() && item.getItemMeta() instanceof Damageable) { + if (!nbt.getBoolean("Unbreakable") && item.getItemMeta() instanceof Damageable) { ItemMeta meta = item.getItemMeta(); ((Damageable) meta).setDamage(((Damageable) meta).getDamage() + damage); item.setItemMeta(meta);