Examples of ITransactor


Examples of buildcraft.core.inventory.ITransactor

      CraftingResult<ItemStack> craftResult = activeRecipe.craft(this, false);

      if (craftResult != null) {
        ItemStack result = craftResult.crafted.copy();

        ITransactor trans = Transactor.getTransactorFor(invOutput);
        trans.add(result, ForgeDirection.UP, true);
      }
    }
  }
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

      TileEntity nearbyTile = robot.worldObj.getTileEntity(station.x() + dir.offsetX, station.y()
          + dir.offsetY, station.z()
          + dir.offsetZ);

      if (nearbyTile != null && nearbyTile instanceof IInventory) {
        ITransactor trans = Transactor.getTransactorFor(nearbyTile);

        ItemStack added = trans.add(invSlot.getStackInSlot(), dir.getOpposite(), doInsert);

        if (doInsert) {
          invSlot.decreaseStackInSlot(added.stackSize);
        }
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

  private void craft() {
    if (tryCraft(true).size() == 0 && output != null) {
      crafted = true;

      ITransactor transactor = Transactor.getTransactorFor(robot);

      transactor.add(output, ForgeDirection.UNKNOWN, true);
    }
  }
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

          startDelegateAI(new AIRobotGotoStation(robot, stationFound));

          return;
        }

        ITransactor trans = Transactor.getTransactorFor(table);

        for (IInvSlot s : InventoryIterator.getIterable(robot)) {
          if (s.getStackInSlot() != null) {
            ItemStack added = trans.add(s.getStackInSlot(), ForgeDirection.UNKNOWN, true);

            if (added.stackSize == 0) {
              terminate();
            } else if (added.stackSize == s.getStackInSlot().stackSize) {
              s.setStackInSlot(null);
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

  }

  @Override
  public ItemStack receiveItem(ItemStack stack) {
    if (StackHelper.isMatchingItem(stack, expectedResult.crafted)) {
      ITransactor robotTransactor = Transactor.getTransactorFor(robot);
      ItemStack added = robotTransactor.add(stack, ForgeDirection.UNKNOWN, true);

      stack.stackSize -= added.stackSize;

      return stack;
    } else {
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

      AIRobotSearchRandomGroundBlock aiFind = (AIRobotSearchRandomGroundBlock) ai;

      startDelegateAI(new AIRobotGotoBlock(robot, aiFind.blockFound.x, aiFind.blockFound.y + flyingHeight,
          aiFind.blockFound.z));
    } else if (ai instanceof AIRobotGotoBlock) {
      ITransactor t = Transactor.getTransactorFor(robot);
      ItemStack stack = t.remove(TNT_FILTER, ForgeDirection.UNKNOWN, true);

      if (stack != null && stack.stackSize > 0) {
        EntityTNTPrimed tnt = new EntityTNTPrimed(robot.worldObj, robot.posX + 0.25, robot.posY - 1,
          robot.posZ + 0.25,
          robot);
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

        TileEntity nearbyTile = robot.worldObj.getTileEntity(station.x() + dir.offsetX,
            station.y()
                + dir.offsetY, station.z() + dir.offsetZ);

        if (nearbyTile != null && nearbyTile instanceof IInventory) {
          ITransactor trans = Transactor.getTransactorFor(nearbyTile);

          itemFound = trans.remove(filter, dir.getOpposite(), true);

          if (itemFound != null) {
            break;
          }
        }
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

        TileEntity nearbyTile = robot.worldObj.getTileEntity(station.x() + dir.offsetX, station.y()
            + dir.offsetY, station.z()
            + dir.offsetZ);

        if (nearbyTile != null && nearbyTile instanceof IInventory) {
          ITransactor trans = Transactor.getTransactorFor(nearbyTile);

          if (trans.remove(filter, dir.getOpposite(), false) != null) {
            return true;
          }
        }
      }
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

            station.y()
                + dir.offsetY, station.z() + dir.offsetZ);

        if (nearbyTile != null && nearbyTile instanceof IInventory) {
          IInventory tileInventory = (IInventory) nearbyTile;
          ITransactor robotTransactor = Transactor.getTransactorFor(robot);

          for (IInvSlot slot : InventoryIterator.getIterable(tileInventory, dir.getOpposite())) {
            ItemStack stack = slot.getStackInSlot();

            if (stack != null) {
              if (ActionRobotFilter.canInteractWithItem(station, filter, ActionStationProvideItems.class)
                  && filter.matches(stack)) {

                ITransactor t = Transactor.getTransactorFor(robot);

                if (quantity == -1) {

                  ItemStack added = t.add(slot.getStackInSlot(), ForgeDirection.UNKNOWN, true);
                  slot.decreaseStackInSlot(added.stackSize);
                  return;
                } else {
                  ItemStack toAdd = slot.getStackInSlot().copy();

                  if (toAdd.stackSize >= quantity) {
                    toAdd.stackSize = quantity;
                  }

                  ItemStack added = t.add(toAdd, ForgeDirection.UNKNOWN, true);
                  slot.decreaseStackInSlot(added.stackSize);
                  return;
                }
              }
            }
View Full Code Here

Examples of buildcraft.core.inventory.ITransactor

      if (qty < toAdd.stackSize) {
        toAdd.stackSize = qty;
      }

      ITransactor t = Transactor.getTransactorFor(this);
      ItemStack added = t.add(toAdd, ForgeDirection.UNKNOWN, true);

      if (added.stackSize >= stack.stackSize) {
        return null;
      } else {
        stack.stackSize -= added.stackSize;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.