Search in sources :

Example 1 with ItemCircuitBoard

use of forestry.core.circuits.ItemCircuitBoard in project ForestryMC by ForestryMC.

the class SocketWidget method handleMouseClick.

@Override
public void handleMouseClick(int mouseX, int mouseY, int mouseButton) {
    ItemStack itemstack = manager.minecraft.player.inventory.getItemStack();
    if (itemstack.isEmpty()) {
        return;
    }
    Item held = itemstack.getItem();
    Container container = manager.gui.inventorySlots;
    if (!(container instanceof IContainerSocketed)) {
        return;
    }
    IContainerSocketed containerSocketed = (IContainerSocketed) container;
    // Insert chipsets
    if (held instanceof ItemCircuitBoard) {
        containerSocketed.handleChipsetClick(slot);
    } else if (held instanceof ISolderingIron) {
        containerSocketed.handleSolderingIronClick(slot);
    }
}
Also used : Item(net.minecraft.item.Item) Container(net.minecraft.inventory.Container) ISolderingIron(forestry.core.circuits.ISolderingIron) ItemCircuitBoard(forestry.core.circuits.ItemCircuitBoard) ItemStack(net.minecraft.item.ItemStack) IContainerSocketed(forestry.core.gui.IContainerSocketed)

Aggregations

ISolderingIron (forestry.core.circuits.ISolderingIron)1 ItemCircuitBoard (forestry.core.circuits.ItemCircuitBoard)1 IContainerSocketed (forestry.core.gui.IContainerSocketed)1 Container (net.minecraft.inventory.Container)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1