// Proceed only if this is a CraftingInventory
if (!(event.getInventory() instanceof CraftingInventory))
return;
// Store the slot type that was clicked
SlotType slotType = event.getSlotType();
// Proceed only if a CRAFTING or RESULT slot was clicked
if (slotType.equals(InventoryType.SlotType.CRAFTING) ||
slotType.equals(InventoryType.SlotType.RESULT)) {
CraftingInventory inventory = (CraftingInventory) event.getInventory();
Player player = (Player) event.getWhoClicked();
// If the RESULT slot was shift-clicked, emulate
// shift click behavior for it
if (slotType.equals(InventoryType.SlotType.RESULT) &&
event.isShiftClick()) {
emulateSpecialRecipeResultShiftClick(inventory, player);
}
// Otherwise check for special recipe matches
else {