use of buildcraft.lib.inventory.filter.AggregateFilter in project BuildCraft by BuildCraft.
the class BoardRobotPlanter method update.
@Override
public void update() {
if (robot.getHeldItem() == null) {
startDelegateAI(new AIRobotFetchAndEquipItemStack(robot, new AggregateFilter(filter, ActionRobotFilter.getGateFilter(robot.getLinkedStation()))));
} else {
final ItemStack itemStack = robot.getHeldItem();
IBlockFilter blockFilter = new IBlockFilter() {
@Override
public boolean matches(World world, BlockPos pos) {
return !BuildCraftAPI.getWorldProperty("replaceable").get(world, pos) && isPlantable(itemStack, world, pos) && !robot.getRegistry().isTaken(new ResourceIdBlock(pos));
}
};
startDelegateAI(new AIRobotSearchAndGotoBlock(robot, true, blockFilter, 1));
}
}
Aggregations