public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4)
    {
        int var5 = par0IBlockAccess.getBlockId(par1, par2, par3);

        if (var5 == Block.redstoneWire.blockID)
        {
            return true;
        }
        else if (var5 == 0)
        {
            return false;
        }
        else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID)
        {
            if (Block.blocksList[var5] instanceof IConnectRedstone)
            {
                return ((IConnectRedstone)Block.blocksList[var5]).canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4);
            }
            return Block.blocksList[var5].canProvidePower() && par4 != -1;
        }
        else
        {
            int var6 = par0IBlockAccess.getBlockMetadata(par1, par2, par3);
            return par4 == (var6 & 3) || par4 == Direction.footInvisibleFaceRemap[var6 & 3];
        }
    }