Package buildcraft.core.robots

Examples of buildcraft.core.robots.AIRobotGotoSleep


          ArrayStackFilter arrayFilter = new ArrayStackOrListFilter(
              filteredFilter.toArray(new ItemStack[filteredFilter.size()]));

          startDelegateAI(new AIRobotFetchAndEquipItemStack(robot, arrayFilter));
        } else {
          startDelegateAI(new AIRobotGotoSleep(robot));
        }
      } else {
        startDelegateAI(new AIRobotFetchAndEquipItemStack(robot, stackFilter));
      }
    } else {
View Full Code Here


  public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotGotoRandomGroundBlock) {
      AIRobotGotoRandomGroundBlock gotoBlock = (AIRobotGotoRandomGroundBlock) ai;

      if (gotoBlock.blockFound == null) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      } else {
        startDelegateAI(new AIRobotUseToolOnBlock(robot, gotoBlock.blockFound));
      }
    } else if (ai instanceof AIRobotSearchBlock) {
      AIRobotSearchBlock gotoBlock = (AIRobotSearchBlock) ai;

      if (gotoBlock.blockFound != null
          && robot.getRegistry().take(new ResourceIdBlock(gotoBlock.blockFound), robot)) {

        if (blockFound != null) {
          robot.getRegistry().release(new ResourceIdBlock(blockFound));
        }

        blockFound = gotoBlock.blockFound;
        startDelegateAI(new AIRobotGotoBlock(robot, gotoBlock.path));
      } else {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotGotoBlock) {
      startDelegateAI(new AIRobotUseToolOnBlock(robot, blockFound));
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
      if (robot.getHeldItem() == null) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    }
  }
View Full Code Here

            .getLinkedStation()), robot.getZoneToWork()));
      }
    }

    if (!loadFound && !unloadFound) {
      startDelegateAI(new AIRobotGotoSleep(robot));

      // reset load and unload so that upon waking up both are tried.
      loadFound = true;
      unloadFound = true;
    }
View Full Code Here

  public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotGotoStationAndLoadFluids) {
      startDelegateAI(new AIRobotGotoStationAndUnloadFluids(robot, robot.getZoneToWork()));
    } else if (ai instanceof AIRobotGotoStationAndUnloadFluids) {
      if (!ai.success()) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    }
  }
View Full Code Here

  @Override
  public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchBlock) {
      if (!ai.success()) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      } else {
        blockFound = ((AIRobotSearchBlock) ai).blockFound;

        if (!robot.getRegistry().take(new ResourceIdBlock (blockFound), robot)) {
          blockFound = null;
          startDelegateAI(new AIRobotGotoSleep(robot));
        } else {
          startDelegateAI(new AIRobotGotoBlock(robot, ((AIRobotSearchBlock) ai).path));
        }
      }
    } else if (ai instanceof AIRobotGotoBlock) {
      if (!ai.success()) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      } else {
        startDelegateAI(new AIRobotPumpBlock(robot, blockFound));
      }
    } else if (ai instanceof AIRobotGotoStationAndUnloadFluids) {
      robot.getRegistry().take(new ResourceIdBlock (blockFound), robot);

      if (!ai.success()) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    }
  }
View Full Code Here

      if (ai.success()) {
        startDelegateAI(new AIRobotUnload(robot));
      } else {
        robot.releaseResources();
        currentRequest = null;
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotSearchStackRequest) {
      if (!ai.success()) {
        craftingBlacklist.clear();
        currentRequest = null;
        startDelegateAI(new AIRobotGotoSleep(robot));
      } else {
        currentRequest = ((AIRobotSearchStackRequest) ai).request;

        if (!currentRequest.station.take(robot)) {
          currentRequest = null;
View Full Code Here

        startDelegateAI(new AIRobotFetchItem(robot, 250, ActionRobotFilter.getGateFilter(robot
            .getLinkedStation()), robot.getZoneToWork()));
      } else if (robot.containsItems()) {
        startDelegateAI(new AIRobotGotoStationAndUnload(robot, robot.getZoneToWork()));
      } else {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotGotoStationAndUnload) {
      if (!ai.success()) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    }
  }
View Full Code Here

  @Override
  public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotFetchAndEquipItemStack) {
      if (robot.getHeldItem() == null) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotSearchEntity) {
      AIRobotSearchEntity mobAI = (AIRobotSearchEntity) ai;

      if (mobAI.target != null) {
        startDelegateAI(new AIRobotAttack(robot, ((AIRobotSearchEntity) ai).target));
      } else {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    }
  }
View Full Code Here

  @Override
  public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotFetchAndEquipItemStack) {
      if (robot.getHeldItem() == null) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotSearchEntity) {
      AIRobotSearchEntity mobAI = (AIRobotSearchEntity) ai;

      if (mobAI.target != null) {
        startDelegateAI(new AIRobotAttack(robot, ((AIRobotSearchEntity) ai).target));
      } else {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    }
  }
View Full Code Here

        }

        blockFound = searchAI.blockFound;
        startDelegateAI(new AIRobotGotoBlock(robot, searchAI.path));
      } else {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotGotoBlock) {
      AIRobotGotoBlock gotoBlock = (AIRobotGotoBlock) ai;

      startDelegateAI(new AIRobotUseToolOnBlock(robot, blockFound));
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
      if (robot.getHeldItem() == null) {
        startDelegateAI(new AIRobotGotoSleep(robot));
      }
    } else if (ai instanceof AIRobotUseToolOnBlock) {
      robot.getRegistry().release(new ResourceIdBlock(blockFound));
      blockFound = null;
    }
View Full Code Here

TOP

Related Classes of buildcraft.core.robots.AIRobotGotoSleep

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.