use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.
the class BoardRobotPlanter method delegateAIEnded.
@Override
public void delegateAIEnded(AIRobot ai) {
if (ai instanceof AIRobotSearchAndGotoBlock) {
if (ai.success()) {
blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
startDelegateAI(new AIRobotPlant(robot, blockFound));
} else {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotPlant) {
releaseBlockFound();
} else if (ai instanceof AIRobotFetchAndEquipItemStack) {
if (!ai.success()) {
startDelegateAI(new AIRobotGotoSleep(robot));
}
}
}
use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.
the class BoardRobotFarmer method delegateAIEnded.
@Override
public void delegateAIEnded(AIRobot ai) {
if (ai instanceof AIRobotSearchAndGotoBlock) {
if (ai.success()) {
blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
startDelegateAI(new AIRobotUseToolOnBlock(robot, blockFound));
} else {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotFetchAndEquipItemStack) {
if (!ai.success()) {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotUseToolOnBlock) {
releaseBlockFound();
}
}
use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.
the class BoardRobotPump method delegateAIEnded.
@Override
public void delegateAIEnded(AIRobot ai) {
if (ai instanceof AIRobotSearchAndGotoBlock) {
if (ai.success()) {
blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
startDelegateAI(new AIRobotPumpBlock(robot, blockFound));
} else {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotPumpBlock) {
releaseBlockFound();
} else if (ai instanceof AIRobotGotoStationAndUnloadFluids) {
if (!ai.success()) {
startDelegateAI(new AIRobotGotoSleep(robot));
}
}
}
use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.
the class BoardRobotStripes method delegateAIEnded.
@Override
public void delegateAIEnded(AIRobot ai) {
if (ai instanceof AIRobotSearchAndGotoBlock) {
if (ai.success()) {
blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
startDelegateAI(new AIRobotStripesHandler(robot, blockFound));
} else {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotFetchAndEquipItemStack) {
if (!ai.success()) {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotStripesHandler) {
releaseBlockFound();
}
}
use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.
the class BoardRobotGenericSearchBlock method update.
@Override
public void update() {
updateFilter();
startDelegateAI(new AIRobotSearchAndGotoBlock(robot, false, new IBlockFilter() {
@Override
public boolean matches(World world, BlockPos pos) {
if (isExpectedBlock(world, pos) && !robot.getRegistry().isTaken(new ResourceIdBlock(pos))) {
return matchesGateFilter(world, pos);
} else {
return false;
}
}
}));
}
Aggregations