def xy_from_block(self,blockname):
    """
    Parses a block name and extracts the X and Y offset.
    returns x, y
    """

    try:
        blockParts = blockname.split('_')
        if blockParts[0].lower() == 'block':
            blockParts.pop(0)
        X = int(blockParts[0][1:])
        Y = int(blockParts[1][1:])

        return X, Y
    except:
        return -1, -1