if (stack == null) { MainClass.log("Stack is null"); } else { if (stack.getType() == Material.AIR) { MainClass.log("Stack material is AIR"); } else { MainClass.log("Stack material is not AIR"); } }