use of buildcraft.robotics.ai.AIRobotGotoStationAndUnloadFluids 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.AIRobotGotoStationAndUnloadFluids in project BuildCraft by BuildCraft.
the class BoardRobotFluidCarrier method update.
@Override
public void update() {
if (!robotHasFluid()) {
IFluidFilter filter = ActionRobotFilter.getGateFluidFilter(robot.getLinkedStation());
startDelegateAI(new AIRobotGotoStationAndLoadFluids(robot, filter));
} else {
startDelegateAI(new AIRobotGotoStationAndUnloadFluids(robot));
}
}
use of buildcraft.robotics.ai.AIRobotGotoStationAndUnloadFluids in project BuildCraft by BuildCraft.
the class BoardRobotPump method update.
@Override
public void update() {
final IWorldProperty isFluidSource = BuildCraftAPI.getWorldProperty("fluidSource");
FluidStack tank = robot.getTankInfo(null)[0].fluid;
if (tank != null && tank.amount > 0) {
startDelegateAI(new AIRobotGotoStationAndUnloadFluids(robot));
} else {
updateFilter();
startDelegateAI(new AIRobotSearchAndGotoBlock(robot, false, new IBlockFilter() {
@Override
public boolean matches(World world, BlockPos pos) {
if (isFluidSource.get(world, pos) && !robot.getRegistry().isTaken(new ResourceIdBlock(pos))) {
return matchesGateFilter(world, pos);
} else {
return false;
}
}
}));
}
}
Aggregations