various minor fixes
This commit is contained in:
parent
73198c4a7b
commit
d70184c3ae
4 changed files with 19 additions and 4 deletions
|
@ -66,6 +66,11 @@ public class AIRobotCraftWorkbench extends AIRobotCraftGeneric {
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
if (recipe == null) {
|
||||
// loading error
|
||||
terminate();
|
||||
return;
|
||||
}
|
||||
|
||||
// [1] look for a crafting order
|
||||
// -- if none, clear temporary item blacklist and sleep
|
||||
|
|
|
@ -46,8 +46,12 @@ public class AIRobotGotoRandomGroundBlock extends AIRobot {
|
|||
} else {
|
||||
if (!pathFindingJob.isAlive()) {
|
||||
LinkedList<BlockIndex> path = pathFinding.getResult();
|
||||
path.removeLast();
|
||||
startDelegateAI(new AIRobotGotoBlock(robot, path));
|
||||
if (path.size() == 0) {
|
||||
terminate();
|
||||
} else {
|
||||
path.removeLast();
|
||||
startDelegateAI(new AIRobotGotoBlock(robot, path));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,12 @@ public class AIRobotLoad extends AIRobot {
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
if (filter == null) {
|
||||
// loading error
|
||||
terminate();
|
||||
return;
|
||||
}
|
||||
|
||||
waitedCycles++;
|
||||
|
||||
if (waitedCycles > 40) {
|
||||
|
|
|
@ -100,7 +100,7 @@ public class DockingStation implements IDockingStation {
|
|||
}
|
||||
|
||||
public boolean takeAsMain(EntityRobotBase robot) {
|
||||
if (robotTaking == null) {
|
||||
if (robotTakingId == EntityRobotBase.NULL_ROBOT_ID) {
|
||||
linkIsMain = true;
|
||||
robotTaking = robot;
|
||||
robotTakingId = robot.getRobotId();
|
||||
|
@ -111,7 +111,7 @@ public class DockingStation implements IDockingStation {
|
|||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
return robotTakingId == robot.getRobotId();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue