mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Fixed an issue when unequipping item
This commit is contained in:
parent
03a49d0589
commit
b8200c9f11
@ -117,9 +117,10 @@ public class PlayerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onArmorEquip(ArmorEquipEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
NBTItem item = NBTItem.get(event.getNewArmorPiece());
|
||||
if (!PlayerData.get(player).getRPG().canUse(item, true))
|
||||
if (event.getNewArmorPiece() == null)
|
||||
return;
|
||||
|
||||
if (!PlayerData.get(event.getPlayer()).getRPG().canUse(NBTItem.get(event.getNewArmorPiece()), true))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user