diff --git a/lib/MMOLib.jar b/lib/MMOLib.jar index dc52a2b2..ede57bc4 100644 Binary files a/lib/MMOLib.jar and b/lib/MMOLib.jar differ diff --git a/src/main/java/net/Indyuce/mmoitems/MMOItems.java b/src/main/java/net/Indyuce/mmoitems/MMOItems.java index 85e59687..140f521b 100644 --- a/src/main/java/net/Indyuce/mmoitems/MMOItems.java +++ b/src/main/java/net/Indyuce/mmoitems/MMOItems.java @@ -47,7 +47,7 @@ import net.Indyuce.mmoitems.listener.CustomSoundListener; import net.Indyuce.mmoitems.listener.DisableInteractions; import net.Indyuce.mmoitems.listener.ElementListener; import net.Indyuce.mmoitems.listener.ItemUse; -import net.Indyuce.mmoitems.listener.NewDurabilityListener; +import net.Indyuce.mmoitems.listener.DurabilityListener; import net.Indyuce.mmoitems.listener.PlayerListener; import net.Indyuce.mmoitems.listener.version.Listener_v1_13; import net.Indyuce.mmoitems.manager.AbilityManager; @@ -146,7 +146,7 @@ public class MMOItems extends JavaPlugin { Bukkit.getPluginManager().registerEvents(new ItemUse(), this); Bukkit.getPluginManager().registerEvents(new PlayerListener(), this); Bukkit.getPluginManager().registerEvents(new CustomSoundListener(), this); - Bukkit.getPluginManager().registerEvents(new NewDurabilityListener(), this); + Bukkit.getPluginManager().registerEvents(new DurabilityListener(), this); Bukkit.getPluginManager().registerEvents(new DisableInteractions(), this); Bukkit.getPluginManager().registerEvents(new GuiListener(), this); Bukkit.getPluginManager().registerEvents(new ElementListener(), this); diff --git a/src/main/java/net/Indyuce/mmoitems/api/item/plugin/identify/UnidentifiedItem.java b/src/main/java/net/Indyuce/mmoitems/api/item/plugin/identify/UnidentifiedItem.java index 5b9bab87..b6e41cef 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/item/plugin/identify/UnidentifiedItem.java +++ b/src/main/java/net/Indyuce/mmoitems/api/item/plugin/identify/UnidentifiedItem.java @@ -9,8 +9,6 @@ import java.util.List; import java.util.Map; import org.bukkit.ChatColor; -import org.bukkit.attribute.Attribute; -import org.bukkit.attribute.AttributeModifier; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -107,12 +105,6 @@ public class UnidentifiedItem extends ConfigItem { ItemMeta meta = unidentified.getItemMeta(); meta.addItemFlags(ItemFlag.values()); meta.setUnbreakable(true); - if(meta.getAttributeModifiers() != null) - for(Attribute att : meta.getAttributeModifiers().keySet()) { - if(meta.getAttributeModifiers(att) != null) - for(AttributeModifier am : meta.getAttributeModifiers(att)) - meta.removeAttributeModifier(att, am); - } meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); meta.setLore(lore); unidentified.setItemMeta(meta); diff --git a/src/main/java/net/Indyuce/mmoitems/listener/NewDurabilityListener.java b/src/main/java/net/Indyuce/mmoitems/listener/DurabilityListener.java similarity index 87% rename from src/main/java/net/Indyuce/mmoitems/listener/NewDurabilityListener.java rename to src/main/java/net/Indyuce/mmoitems/listener/DurabilityListener.java index b9e185cd..732dd739 100644 --- a/src/main/java/net/Indyuce/mmoitems/listener/NewDurabilityListener.java +++ b/src/main/java/net/Indyuce/mmoitems/listener/DurabilityListener.java @@ -9,7 +9,7 @@ import org.bukkit.event.player.PlayerItemMendEvent; import net.Indyuce.mmoitems.api.interaction.util.DurabilityItem; import net.mmogroup.mmolib.MMOLib; -public class NewDurabilityListener implements Listener { +public class DurabilityListener implements Listener { @EventHandler(ignoreCancelled = true) public void a(PlayerItemDamageEvent event) { @@ -32,7 +32,7 @@ public class NewDurabilityListener implements Listener { } event.setCancelled(true); - event.getItem().setItemMeta(item.toItem().getItemMeta()); + MMOLib.plugin.getVersion().getWrapper().applyDurabilityData(event.getItem(), item.toItem()); } }