Search in sources :

Example 1 with AIRobotSearchAndGotoBlock

use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.

the class BoardRobotPlanter method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotPlant(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotPlant) {
        releaseBlockFound();
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotPlant(buildcraft.robotics.ai.AIRobotPlant) AIRobotFetchAndEquipItemStack(buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)

Example 2 with AIRobotSearchAndGotoBlock

use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.

the class BoardRobotFarmer method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotUseToolOnBlock(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotUseToolOnBlock) {
        releaseBlockFound();
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotUseToolOnBlock(buildcraft.robotics.ai.AIRobotUseToolOnBlock) AIRobotFetchAndEquipItemStack(buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)

Example 3 with AIRobotSearchAndGotoBlock

use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock 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));
        }
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotGotoStationAndUnloadFluids(buildcraft.robotics.ai.AIRobotGotoStationAndUnloadFluids) AIRobotPumpBlock(buildcraft.robotics.ai.AIRobotPumpBlock)

Example 4 with AIRobotSearchAndGotoBlock

use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.

the class BoardRobotStripes method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotStripesHandler(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotStripesHandler) {
        releaseBlockFound();
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotStripesHandler(buildcraft.robotics.ai.AIRobotStripesHandler) AIRobotFetchAndEquipItemStack(buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)

Example 5 with AIRobotSearchAndGotoBlock

use of buildcraft.robotics.ai.AIRobotSearchAndGotoBlock in project BuildCraft by BuildCraft.

the class BoardRobotGenericSearchBlock method update.

@Override
public void update() {
    updateFilter();
    startDelegateAI(new AIRobotSearchAndGotoBlock(robot, false, new IBlockFilter() {

        @Override
        public boolean matches(World world, BlockPos pos) {
            if (isExpectedBlock(world, pos) && !robot.getRegistry().isTaken(new ResourceIdBlock(pos))) {
                return matchesGateFilter(world, pos);
            } else {
                return false;
            }
        }
    }));
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) ResourceIdBlock(buildcraft.api.robots.ResourceIdBlock) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World) IBlockFilter(buildcraft.core.lib.utils.IBlockFilter)

Aggregations

AIRobotSearchAndGotoBlock (buildcraft.robotics.ai.AIRobotSearchAndGotoBlock)7 AIRobotFetchAndEquipItemStack (buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)4 AIRobotGotoSleep (buildcraft.robotics.ai.AIRobotGotoSleep)4 ResourceIdBlock (buildcraft.api.robots.ResourceIdBlock)3 IBlockFilter (buildcraft.core.lib.utils.IBlockFilter)3 BlockPos (net.minecraft.util.math.BlockPos)3 World (net.minecraft.world.World)3 AIRobotGotoStationAndUnloadFluids (buildcraft.robotics.ai.AIRobotGotoStationAndUnloadFluids)2 IWorldProperty (buildcraft.api.core.IWorldProperty)1 AggregateFilter (buildcraft.lib.inventory.filter.AggregateFilter)1 AIRobotPlant (buildcraft.robotics.ai.AIRobotPlant)1 AIRobotPumpBlock (buildcraft.robotics.ai.AIRobotPumpBlock)1 AIRobotStripesHandler (buildcraft.robotics.ai.AIRobotStripesHandler)1 AIRobotUseToolOnBlock (buildcraft.robotics.ai.AIRobotUseToolOnBlock)1 ItemStack (net.minecraft.item.ItemStack)1 FluidStack (net.minecraftforge.fluids.FluidStack)1