if(!getInventory().isFull()){
//inventory not full <28
}else{
//inventory is full >28
}
Or you coule check outgetInventory().isFull()
getInventory().isEmpty()
.isEmpty will only work when there is no items in the inventory. So you are better of doing !getInventory().isFull() because that will let you do stuff while the inventory is not full and it can still contain items without saying it is full, because you need 28 items for it to be full :p