Search in sources :

Example 1 with GhostOutputSlot

use of mcjty.lib.container.GhostOutputSlot in project RFTools by McJty.

the class GuiStorageScanner method mouseClicked.

@Override
protected void mouseClicked(int x, int y, int button) throws IOException {
    super.mouseClicked(x, y, button);
    craftingGrid.getWindow().mouseClicked(x, y, button);
    if (button == 1) {
        Slot slot = getSlotAtPosition(x, y);
        if (slot instanceof GhostOutputSlot) {
            sendServerCommand(RFToolsMessages.INSTANCE, StorageScannerTileEntity.CMD_CLEARGRID);
        }
    }
}
Also used : GhostOutputSlot(mcjty.lib.container.GhostOutputSlot) GhostOutputSlot(mcjty.lib.container.GhostOutputSlot) Slot(net.minecraft.inventory.Slot)

Example 2 with GhostOutputSlot

use of mcjty.lib.container.GhostOutputSlot in project RFTools by McJty.

the class GuiModularStorage method mouseClicked.

@Override
protected void mouseClicked(int x, int y, int button) throws IOException {
    if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) {
        Slot slot = getSlotAtPosition(x, y);
        if (slot != null && slot.getHasStack()) {
            ItemStack stack = slot.getStack();
            Item item = stack.getItem();
            if (item instanceof ItemBlock) {
                Block block = ((ItemBlock) item).getBlock();
                dumpClasses("Block", block);
            } else {
                dumpClasses("Item", item);
            }
        }
    }
    super.mouseClicked(x, y, button);
    craftingGrid.getWindow().mouseClicked(x, y, button);
    if (button == 1) {
        Slot slot = getSlotAtPosition(x, y);
        if (slot instanceof GhostOutputSlot) {
            if (tileEntity != null) {
                sendServerCommand(RFToolsMessages.INSTANCE, ModularStorageTileEntity.CMD_CLEARGRID);
            } else {
                sendServerCommand(RFTools.MODID, CommandHandler.CMD_CLEAR_GRID);
            }
        }
    }
}
Also used : Item(net.minecraft.item.Item) StorageModuleItem(mcjty.rftools.items.storage.StorageModuleItem) GhostOutputSlot(mcjty.lib.container.GhostOutputSlot) GhostOutputSlot(mcjty.lib.container.GhostOutputSlot) Slot(net.minecraft.inventory.Slot) Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) ItemStack(net.minecraft.item.ItemStack) ItemBlock(net.minecraft.item.ItemBlock)

Aggregations

GhostOutputSlot (mcjty.lib.container.GhostOutputSlot)2 Slot (net.minecraft.inventory.Slot)2 StorageModuleItem (mcjty.rftools.items.storage.StorageModuleItem)1 Block (net.minecraft.block.Block)1 Item (net.minecraft.item.Item)1 ItemBlock (net.minecraft.item.ItemBlock)1 ItemStack (net.minecraft.item.ItemStack)1