use of logisticspipes.proxy.buildcraft.robots.ai.ItemInsertionAIRobot in project LogisticsPipes by RS485.
the class LogisticsRoutingBoardRobot method insertIntoPipe.
private void insertIntoPipe() {
TileEntity tile = targetStationPos.getTileEntity(robot.worldObj);
if (tile instanceof LogisticsTileGenericPipe) {
startDelegateAI(new ItemInsertionAIRobot(robot, (LogisticsTileGenericPipe) tile, this, targetStationSide.getOpposite()));
} else {
dropAndClear();
startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
targetStationPos = null;
}
}
use of logisticspipes.proxy.buildcraft.robots.ai.ItemInsertionAIRobot in project LogisticsPipes by RS485.
the class LogisticsRoutingBoardRobot method delegateAIEnded.
@Override
public void delegateAIEnded(AIRobot ai) {
super.delegateAIEnded(ai);
if (ai instanceof AIRobotGotoBlock) {
if (!ai.success()) {
dropAndClear();
startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
} else {
startDelegateAI(new AIRobotStraightMoveTo(robot, (float) targetStationPos.getXCoord() + 0.5F + targetStationSide.offsetX * 0.5F, (float) targetStationPos.getYCoord() + 0.5F + targetStationSide.offsetY * 0.5F, (float) targetStationPos.getZCoord() + 0.5F + targetStationSide.offsetZ * 0.5F));
}
} else if (ai instanceof AIRobotStraightMoveTo) {
if (!ai.success()) {
dropAndClear();
startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
} else {
insertIntoPipe();
}
} else if (ai instanceof ItemInsertionAIRobot) {
for (int i = 0; i < robot.getSizeInventory(); i++) {
robot.setInventorySlotContents(i, null);
}
if (!ai.success()) {
dropAndClear();
} else {
items.clear();
}
startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
targetStationPos = null;
}
}
Aggregations