int armorSlot = ((Armor) item.getMaterial()).getEquipableSlot();
if (inv.getArmor().get(armorSlot) != null) {
return false;
}
boolean canSet = inv.getArmor().canSet(armorSlot, item);
InventoryCanSetEvent event = player.getEngine().getEventManager().callEvent(new InventoryCanSetEvent(inv.getArmor(), new BlockCause(block), armorSlot, item, !canSet));
if (event.isCancelled()) {
return false;
}
inv.getArmor().set(armorSlot, item, true);
slot.addAmount(-1);
return true;