Package buildcraft.core.inventory

Examples of buildcraft.core.inventory.TransactorSimple


  }

  @Override
  public void start() {
    double previousDistance = Double.MAX_VALUE;
    TransactorSimple inventoryInsert = new TransactorSimple(robot);

    for (Object o : robot.worldObj.loadedEntityList) {
      Entity e = (Entity) o;

      if (!e.isDead
View Full Code Here


      scanForItem();
    } else {
      pickTime++;

      if (pickTime > 5) {
        TransactorSimple inventoryInsert = new TransactorSimple(robot);

        target.getEntityItem().stackSize -= inventoryInsert.inject(
            target.getEntityItem(), ForgeDirection.UNKNOWN,
            true);

        if (target.getEntityItem().stackSize <= 0) {
          target.setDead();
View Full Code Here

    }
  }

  private void scanForItem() {
    double previousDistance = Double.MAX_VALUE;
    TransactorSimple inventoryInsert = new TransactorSimple(robot);

    for (Object o : robot.worldObj.loadedEntityList) {
      Entity e = (Entity) o;

      if (!e.isDead
          && e instanceof EntityItem
          && !BoardRobotPicker.targettedItems.contains(e.getEntityId())
          && !robot.isKnownUnreachable(e)
          && (zone == null || zone.contains(e.posX, e.posY, e.posZ))) {
        double dx = e.posX - robot.posX;
        double dy = e.posY - robot.posY;
        double dz = e.posZ - robot.posZ;

        double sqrDistance = dx * dx + dy * dy + dz * dz;
        double maxDistance = maxRange * maxRange;

        if (sqrDistance >= maxDistance) {
          continue;
        } else if (stackFilter != null && !stackFilter.matches(((EntityItem) e).getEntityItem())) {
          continue;
        } else {
          EntityItem item = (EntityItem) e;

          if (inventoryInsert.inject(item.getEntityItem(), ForgeDirection.UNKNOWN, false) > 0) {
            if (target == null) {
              previousDistance = sqrDistance;
              target = item;
            } else {
              if (sqrDistance < previousDistance) {
View Full Code Here

TOP

Related Classes of buildcraft.core.inventory.TransactorSimple

Copyright © 2018 www.massapicom. 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.