Package org.bukkit.event.inventory.InventoryType

Examples of org.bukkit.event.inventory.InventoryType.SlotType


        // 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 {
View Full Code Here


    System.out.println("event.getSlot() "+event.getSlot());
    */
   
    boolean isShiftClick = event.isShiftClick();
    InventoryType inventoryType = event.getInventory().getType();
    SlotType slotType = event.getSlotType();
    ItemStack cursor = event.getCursor();
    ItemStack currentItem = event.getCurrentItem();
   
    if (isShiftClick)
    {
View Full Code Here

TOP

Related Classes of org.bukkit.event.inventory.InventoryType.SlotType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.