Shouldn't it be `|| stack.getAmount() <= 0`?