}
@Override
public void actionActivate(IStatementContainer container, IStatementParameter[] parameters) {
Pipe<?> pipe = ((Gate) container).pipe;
RobotRegistry registry = RobotRegistry.getRegistry(pipe.getWorld());
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {
DockingStation station = pipe.container.getStation(d);
if (station != null && station.robotTaking() != null) {
EntityRobot robot = (EntityRobot) station.robotTaking();
AIRobot ai = robot.getOverridingAI();
if (ai != null) {
continue;
}
DockingStation newStation = station;
if (parameters[0] != null) {
StatementParameterItemStack stackParam = (StatementParameterItemStack) parameters[0];
ItemStack item = stackParam.getItemStack();
if (item != null && item.getItem() instanceof ItemMapLocation) {
BlockIndex index = ItemMapLocation.getBlockIndex(item);
if (index != null) {
ForgeDirection side = ItemMapLocation.getSide(item);
DockingStation paramStation = (DockingStation)
registry.getStation(index.x,
index.y, index.z, side);
if (paramStation != null) {
newStation = paramStation;
}