use of buildcraft.api.robots.AIRobot in project BuildCraft by BuildCraft.
the class EntityRobot method getDebugInfo.
@Override
public void getDebugInfo(List<String> left, List<String> right, EnumFacing side) {
left.add("Robot:");
if (board != null) {
if (board.getNBTHandler() != null) {
left.add(" " + board.getNBTHandler().getID());
} else {
left.add(" " + board.getClass());
}
} else {
left.add(" Unknown type");
}
if (getBattery() != null) {
left.add(" Battery " + getBattery().getEnergyStored() + "/" + getBattery().getMaxEnergyStored() + " RF");
}
left.add(String.format("Position: %.2f, %.2f, %.2f", posX, posY, posZ));
left.add("AI tree:");
AIRobot aiRobot = mainAI;
while (aiRobot != null) {
left.add("- " + RobotManager.getAIRobotName(aiRobot.getClass()) + " (" + aiRobot.getEnergyCost() + " RF/t)");
if (aiRobot instanceof IDebuggable) {
((IDebuggable) aiRobot).getDebugInfo(left, right, side);
}
aiRobot = aiRobot.getDelegateAI();
}
}
use of buildcraft.api.robots.AIRobot in project BuildCraft by BuildCraft.
the class ActionRobotGotoStation method actionActivate.
@Override
public void actionActivate(IStatementContainer container, IStatementParameter[] parameters) {
IRobotRegistry registry = RobotManager.registryProvider.getRegistry(container.getTile().getWorld());
List<DockingStation> stations = RobotUtils.getStations(container.getTile());
for (DockingStation station : stations) {
if (station.robotTaking() != null) {
EntityRobot robot = (EntityRobot) station.robotTaking();
AIRobot ai = robot.getOverridingAI();
if (ai != null) {
continue;
}
DockingStation newStation = station;
if (parameters[0] != null) {
newStation = getStation((StatementParameterItemStack) parameters[0], registry);
}
if (newStation != null) {
robot.overrideAI(new AIRobotGoAndLinkToDock(robot, newStation));
}
}
}
}
Aggregations