Search in sources :

Example 1 with ItemSources

use of gregtech.common.inventory.itemsource.ItemSources in project GregTech by GregTechCEu.

the class CoverCraftingTable method createCraftingRecipeLogic.

private void createCraftingRecipeLogic() {
    this.recipeLogic = new CraftingRecipeLogic(this);
    this.recipeLogic.setItemsCraftedAmount(itemsCrafted);
    ItemSources itemSources = this.recipeLogic.getItemSourceList();
    itemSources.addItemHandler(new InventoryItemSource(coverHolder.getWorld(), toolInventory, -2));
    itemSources.addItemHandler(new InventoryItemSource(coverHolder.getWorld(), internalInventory, -1));
    this.recipeLogic.checkNeighbourInventories(coverHolder.getPos());
}
Also used : InventoryItemSource(gregtech.common.inventory.itemsource.sources.InventoryItemSource) ItemSources(gregtech.common.inventory.itemsource.ItemSources) CraftingRecipeLogic(gregtech.common.metatileentities.storage.CraftingRecipeLogic)

Example 2 with ItemSources

use of gregtech.common.inventory.itemsource.ItemSources in project GregTech by GregTechCEu.

the class MetaTileEntityWorkbench method createCraftingRecipeLogic.

private void createCraftingRecipeLogic(EntityPlayer entityPlayer) {
    if (!getWorld().isRemote) {
        if (recipeLogic == null) {
            this.recipeLogic = new CraftingRecipeLogic(this);
            this.recipeLogic.setItemsCraftedAmount(itemsCrafted);
            ItemSources itemSources = this.recipeLogic.getItemSourceList();
            itemSources.addItemHandler(new InventoryItemSource(getWorld(), toolInventory, -2));
            itemSources.addItemHandler(new InventoryItemSource(getWorld(), internalInventory, -1));
            this.recipeLogic.checkNeighbourInventories(getPos());
        }
        this.listeners.add(entityPlayer);
    }
}
Also used : InventoryItemSource(gregtech.common.inventory.itemsource.sources.InventoryItemSource) ItemSources(gregtech.common.inventory.itemsource.ItemSources)

Aggregations

ItemSources (gregtech.common.inventory.itemsource.ItemSources)2 InventoryItemSource (gregtech.common.inventory.itemsource.sources.InventoryItemSource)2 CraftingRecipeLogic (gregtech.common.metatileentities.storage.CraftingRecipeLogic)1