/clear removes all items from crafting grid regardless of item type
This was caused by the fix for MC-75328.
How to reproduce
- Insert the following command in a repeating command block and power it
clear @p diamond
- Go into survival
- Get any other item in your inventory and move it into the crafting slots
The item gets cleared even though it is not a diamond
Code analysis
The reason for this is that the method net.minecraft.server.commands.ClearInventoryCommand#clearInventory(CommandSourceStack, Collection, Predicate, int) simply calls InventoryMenu#clearCraftingContent() without making use of the ItemPredicateArgument or the maxCount properties.