For checking if a block below is powered use this example:
if(world.isBlockProvidingPowerTo(x, y - 1, z, direction))
{
this.doSomething();
}
y - 1 to check block below your block
direction would be up(above) for checking if it powers your block (I think up is 1 or 0)