int maxStock = cache.filter.getMaxStock(); IItemHandler itemHandler = cache.getItemHandler(side ^ 1); if (!routeItems) { return simulateInsertItemStackIntoInventory(itemHandler, insertingItem, side ^ 1, maxStock);
IItemHandler inv = cache.getItemHandler(i ^ 1); if (inv == null) { continue;
public int simTransferI(int side, ItemStack insertingItem) { if (grid == null) { return 0; } Cache cache = tileCache[side]; if (cache == null) { return 0; } try { ItemStack itemStack = simTransfer(side, insertingItem); return itemStack.isEmpty() ? 0 : itemStack.getCount(); } catch (Exception err) { IItemHandler handler = cache.getItemHandler(side ^ 1); CrashReport crashReport = CrashHelper.makeDetailedCrashReport(err, "Inserting", this, "Inserting Item", insertingItem, "Side", side, "Cache", handler, "Grid", grid); CrashHelper.addSurroundingDetails(crashReport, "ItemDuct", parent); CrashHelper.addInventoryContents(crashReport, "Destination Inventory", handler); throw new ReportedException(crashReport); } }
public IItemHandler getItemHandler(int face) { return getItemHandler(EnumFacing.VALUES[face]); }
public int insertIntoInventory_do(ItemStack stack, int direction) { Cache cache = tileCache[direction]; IItemHandler itemHandler = cache.getItemHandler(direction ^ 1); if (itemHandler == null) { return stack.getCount(); } signalRepoll(); stack = insertItemStackIntoInventory(itemHandler, stack, direction ^ 1, cache.filter.getMaxStock()); return stack.isEmpty() ? 0 : stack.getCount(); }