Improve ItemStack filtering
Manual merge of 0b14804